[Bug middle-end/96988] New: Bad/missing warnings when returning a temporary from an inlined function

2020-09-08 Thread blubban at gmail dot com
: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- Minimal testcase: // compile with: gcc -O2 -Wall bug.cpp static int * foo() { int a = 42; int * b = &a

[Bug c++/96988] Bad/missing warnings when returning a temporary from an inlined function

2020-09-09 Thread blubban at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96988 --- Comment #2 from Alfred Agrell --- Poked this thing a bit more, and discovered that there's no need for inlining, you can reproduce it just as well with an extra {}. And if you copy the function a few times, the warnings start pointing to wro

[Bug c++/80521] Wrong line reported in error for missing template argument in friend class declaration.

2017-04-27 Thread blubban at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80521 Alfred Agrell changed: What|Removed |Added CC||blubban at gmail dot com --- Comment #1

[Bug c++/80264] New: g++ ignores register assignments in template functions

2017-03-30 Thread blubban at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- Created attachment 41092 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41092&action=edit Testcase Input (also attached): template void foo1() { regis

[Bug c++/97221] New: Returning an array unexpectedly favors const overload in return value's constructor

2020-09-27 Thread blubban at gmail dot com via Gcc-bugs
IRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- struct string { const char * m; template string(const char (&str)[N]) { m = "CONST"; }

[Bug c++/91212] [8/9/10/11 Regression] const ignored for ctor arguments within return since r8-2493-g4ce8c5dea53d8073

2020-09-27 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91212 Alfred Agrell changed: What|Removed |Added CC||blubban at gmail dot com --- Comment

[Bug c++/97221] Returning an array unexpectedly favors const overload in return value's constructor

2020-09-27 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97221 Alfred Agrell changed: What|Removed |Added Resolution|--- |DUPLICATE Status|UNCONFIRMED

[Bug other/97280] New: Documentation typo - 'roudnevenl'

2020-10-03 Thread blubban at gmail dot com via Gcc-bugs
ent: other Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html "Outside strict ISO C mode [...], the functions [...] roundeven, roundevenf, roudnevenl, scalbf [...]" Should

[Bug c++/106541] New: Missing -Wuninitialized on self initialization if external code is called earlier in the function

2022-08-05 Thread blubban at gmail dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- struct my_class { int data[4]; }; void fn1(); void fn2() { my_class local = local

[Bug c++/107151] New: Specializing a concepted template can emit bogus assembly

2022-10-04 Thread blubban at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- #include #include template void fun(T); template <> void fun(char c) { std::puts("foo()"); } template void fun(I i)

[Bug c++/103825] New: [12 Regression] ICE on switch on enum class in bitfield

2021-12-24 Thread blubban at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- enum class Type { Pawn }; struct Piece { Type type : 4; }; void foo() { switch (Piece().type) case Type::Pawn:; } The above causes an ICE

[Bug web/103877] New: libstdc++ docs give a bad recommendation for printing C++ defines

2021-12-31 Thread blubban at gmail dot com via Gcc-bugs
Priority: P3 Component: web Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.predefined > You can also run g++ -E -dM - < /dev/null" to display

[Bug libstdc++/103911] New: std::from_chars shouldn't call isdigit

2022-01-04 Thread blubban at gmail dot com via Gcc-bugs
onent: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- In header , function __from_chars_alnum calls std::isdigit(). In addition to looking weird ("everyone" knows ctype is locale dependent and charconv is not),

[Bug c++/102120] New: expected tree that contains 'decl common' structure, have 'identifier_node' in dump_aggr_type, at cp/error.c:786

2021-08-29 Thread blubban at gmail dot com via Gcc-bugs
c Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- Input: union U { int value;

[Bug c++/102198] New: Unused and nonsensical template instantiations used for return type inference end up in the output

2021-09-03 Thread blubban at gmail dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- Input: template int* a() { return x; } template auto b() { return a; } template auto c() ->

[Bug c++/107913] New: Bogus unused variable warning if used in if constexpr false in lambda with default capture by ref

2022-11-29 Thread blubban at gmail dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- template int b() { constexpr int c = 123; constexpr int d = 456; return [&](){

[Bug c++/105595] New: Coroutines can trigger -Wsubobject-linkage

2022-05-13 Thread blubban at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- To reproduce: - Create a minimal coroutine promise - Create a coroutine where any local's type has no linkage (for example a lambda) - #include the above from an

[Bug c++/103871] [11/12/13 Regression] co_await causes build error

2022-05-23 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103871 Alfred Agrell changed: What|Removed |Added CC||blubban at gmail dot com --- Comment

[Bug c++/105804] New: List-initialized argument in await expression is doubly freed

2022-06-01 Thread blubban at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- #include #include struct my_params { std::unique_ptr ptr; // or any other object with nontrivial dtor }; static std

[Bug sanitizer/101758] New: Inconsistent optimizations with UBSan

2021-08-03 Thread blubban at gmail dot com via Gcc-bugs
: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org Target Milestone: --- Input

[Bug c++/114167] New: Capturing a auto..., then unpacking it in a lambda taking Ts..., confuses GCC

2024-02-29 Thread blubban at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- void a(int, int) {} template void b() { [](auto... ch){ [ch...](Ts... newvals) { (a(ch, newvals

[Bug target/107337] -march docs for nocona are missing CX16

2024-03-15 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107337 Alfred Agrell changed: What|Removed |Added CC||blubban at gmail dot com --- Comment

[Bug c++/116584] New: Type/value mismatch confuses error recovery

2024-09-03 Thread blubban at gmail dot com via Gcc-bugs
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- template struct foo; void* bar() { return (decltype(foo<5>)*)5; } No flags needed. Result: : In function 'void* bar()': :5:31: error: type/v

[Bug c++/105804] coroutines: List-initialized argument in await expression is doubly freed

2023-04-16 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105804 Alfred Agrell changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/115318] New: decltype(lambda) with some templates causes ICE

2024-06-01 Thread blubban at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- template struct S {}; template void foo() { using foo_t = decltype([](){}); []() { S{}; }(); } void bar() { foo(); } -std=c++20 : In instantiation of 

[Bug c++/115319] New: ICE when mutating a captured parameter in an explicit-this lambda if a capture is not trivially copyable

2024-06-01 Thread blubban at gmail dot com via Gcc-bugs
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- struct S { S() {} S(const S&) {} }; void a() { [i=0,

[Bug c++/115331] New: [15 regression] ICE-on-invalid passing a typoed lambda to a list-initializer

2024-06-03 Thread blubban at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- struct has_ctor { has_ctor(auto arg) {} }; void aaa() { has_ctor{[]<(){}}; // typo intentional } -std=c+

[Bug c++/115364] New: ICE-on-invalid when calling non-const template member on const object

2024-06-05 Thread blubban at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- struct foo { template void not_const() {} }; void fn(const foo& obj) { obj.not_const<5>(); } No flags needed. :

[Bug libstdc++/112564] New: std::format(std::thread::id) is incorrectly left-aligned

2023-11-16 Thread blubban at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- https://godbolt.org/z/zra9GddY3 N4964 [thread.thread.id]/12 "If the align option is omitted it defaults to >." Both MSVC and

[Bug c++/105667] [C++20] lambas in template argument sometimes causes an ICE (seg fault)

2023-06-30 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105667 Alfred Agrell changed: What|Removed |Added CC||blubban at gmail dot com --- Comment

[Bug c++/110565] New: Incomplete note on why initializing int& with int is ill-formed

2023-07-05 Thread blubban at gmail dot com via Gcc-bugs
rmal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- struct X { X(int&); X(X&&) = delete; // the issue reproduces without this line, but the error is clearer with

[Bug tree-optimization/115423] New: Inlined strcmp optimizes poorly

2024-06-10 Thread blubban at gmail dot com via Gcc-bugs
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- bool g(const char* c) { return __builtin_strcmp(c, ".") == 0 || __builtin_strcmp(c, "..") == 0; } bool h(const char* c) { return

[Bug tree-optimization/115423] Inlined strcmp optimizes poorly

2024-06-11 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115423 --- Comment #3 from Alfred Agrell --- strcmp (c, "ABCDEFGHabcdefgh") || strcmp (c, "ABCDEFGHfoobar") can safely be optimized to 1, you're thinking of strcmp(c, "ABCDEFGHabcdefgh")==0 || strcmp(c, "ABCDEFGHfoobar")==0. Optimizing to multi-byte r

[Bug c++/115318] decltype(lambda) from an template function inside a templated lambda causes ICE

2024-06-13 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115318 --- Comment #2 from Alfred Agrell --- struct a { int c; }; template struct ddd { int f() { using a2 = decltype([](int a::*)->a{}(&a::c)); return [](int a2::*){ return 2; }(&a::c); } }; int xs() { return ddd().f(); }

[Bug rtl-optimization/117393] New: Consider inlining memcmp(a, b, small constant)==0 on -Os

2024-11-01 Thread blubban at gmail dot com via Gcc-bugs
Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- int square(char* a, char* b) { return !__builtin_memcmp(a, b, 4); } -Os Expected: square(char*, char*): mov

[Bug libstdc++/116903] c++ regex accepts } and ] as a literal character.

2024-10-01 Thread blubban at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116903 Alfred Agrell changed: What|Removed |Added CC||blubban at gmail dot com --- Comment

[Bug tree-optimization/118316] New: Missed optimization: while (len > 1) len -= 2;

2025-01-06 Thread blubban at gmail dot com via Gcc-bugs
P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- unsigned foo(char* buf, unsigned len) { while (len > 1) len -= 2; if (len) *buf = 42; retu

[Bug c++/118073] New: Bad diagnostic: 'nontype_argument_pack' not supported by dump_expr

2024-12-16 Thread blubban at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- template struct index_sequence {}; void foo() { index_sequence<5> bar = index_sequence<1>(); } No f

[Bug sanitizer/118972] New: Missing ubsan complaint for double->int cast overflow

2025-02-21 Thread blubban at gmail dot com via Gcc-bugs
P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- int m

[Bug rtl-optimization/118947] New: Missed optimization: GCC forgets stack buffer contents across function call

2025-02-19 Thread blubban at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- void* aaa(); void* bbb() { void* ret = aaa(); char buf[32] = {}; __builtin_memcpy(ret, buf, 32

[Bug rtl-optimization/118946] New: Missed optimization: GCC reserves stack space for optimized-out variable

2025-02-19 Thread blubban at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- void* aaa(); void* bbb() { void* ret = aaa(); char buf[65536*16]; __builtin_memset(buf, 0, 32

[Bug c++/118917] New: 'class declared private here' points to definition instead

2025-02-18 Thread blubban at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- class a { private: class b; }; class a::b {}; void c(a::b&) {} Expected: : In function 'void c(a::b&)': :

[Bug libstdc++/119469] New: iter_rvalue_reference_t is wrong for function types

2025-03-25 Thread blubban at gmail dot com via Gcc-bugs
Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- #include #include bool a1() { return std::is_same_v, int(&)(int)>; } bool a2() { return std::is_same_v, int(&&)(int)>; } bool a3() { return s

[Bug libstdc++/119505] New: : Undefined backreferences should match empty string

2025-03-27 Thread blubban at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- #include #include int main() { std::string s{"a"}; std::regex r{"(b)?\\1"}; std::smatch m; bool result

[Bug libstdc++/119506] New: : \cA matches wrong byte

2025-03-27 Thread blubban at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: blubban at gmail dot com Target Milestone: --- #include #include int main() { std::regex r{"\\cA"}; std::cmatch m; bool result1 = std::regex_search("\x01", m, r); printf("search=%d\n", re