[Bug libstdc++/112642] New: ranges::fold_left tries to access inactive union member of string in constant expression

2023-11-20 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 Bug ID: 112642 Summary: ranges::fold_left tries to access inactive union member of string in constant expression Product: gcc Version: 13.2.1 Status: UNCONFIRMED

[Bug libstdc++/112642] ranges::fold_left tries to access inactive union member of string in constant expression

2023-11-20 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 --- Comment #3 from Miro Palmu --- Further reduced: #include using namespace std::literals; consteval void bar() { auto _ = [](auto s) { return s; }(""s); } int main() { bar(); return 0; }

[Bug c++/112642] ranges::fold_left tries to access inactive union member of string in constant expression

2023-11-21 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 --- Comment #5 from Miro Palmu --- I have been trying to figure out where exactly the bug is and these are my findings. > Or: > > #include > > consteval void bar() { > auto _ = [](std::string s) { return s; }({}); > } > > int main() { >

[Bug c++/112642] ranges::fold_left tries to access inactive union member of string in constant expression

2023-11-22 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 --- Comment #7 from Miro Palmu --- (In reply to Jonathan Wakely from comment #6) > The examples in comment 4 do compile using libstdc++ on clang, if you use > libstdc++ headers from after sept 29 (for trunk) or oct 21 (for gcc-13). I was testin

[Bug c++/112642] ranges::fold_left tries to access inactive union member of string in constant expression

2023-11-22 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 --- Comment #9 from Miro Palmu --- (In reply to Jonathan Wakely from comment #8) > > Also tried it locally with clang 16.0.6 with > > gcc-13.2.1 libstdc++ > > Which gcc-13.2.1 though? That's a snapshot that could date from any time in > the pas

[Bug c++/113021] New: [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member

2023-12-14 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113021 Bug ID: 113021 Summary: [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member Product:

[Bug c++/113021] [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member

2023-12-15 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113021 --- Comment #2 from Miro Palmu --- (In reply to Andrew Pinski from comment #1) > Confirmed. We should reduce this to remove the include file too ... Here is somewhat reduced: ``` #include auto alloc = std::allocator{}; constexpr auto n = 3;

[Bug c++/113021] [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member

2023-12-15 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113021 --- Comment #3 from Miro Palmu --- Here is even more reduced. Notice that if the unused data member `pointer` is removed from `vec` the problem goes away. Same with data member `a` in struct `A`. ``` struct vec { int data; int* pointer;

[Bug c++/113407] New: internal_error with const char* as non-type template parameter with index parameter pack in fold expression

2024-01-15 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113407 Bug ID: 113407 Summary: internal_error with const char* as non-type template parameter with index parameter pack in fold expression Product: gcc Version: 14.0 Status: UN

[Bug c++/109642] False Positive -Wdangling-reference with std::span-like classes

2024-01-17 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109642 Miro Palmu changed: What|Removed |Added CC||miro.palmu at helsinki dot fi --- Comment