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

2023-11-20 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 Jonathan Wakely changed: What|Removed |Added Component|libstdc++ |c++ --- Comment #4 from Jonathan Wake

[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-21 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 --- Comment #6 from Jonathan Wakely --- (In reply to Miro Palmu from comment #5) > If you use libstdc++ on clang these will not compile but with different > errors. The examples in comment 4 do compile using libstdc++ on clang, if you use libst

[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 redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 --- Comment #8 from Jonathan Wakely --- (In reply to Miro Palmu from comment #7) > (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

[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++/112642] ranges::fold_left tries to access inactive union member of string in constant expression

2023-11-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112642 --- Comment #10 from Jonathan Wakely --- (In reply to Miro Palmu from comment #9) > Mine is 13.2.1 20230801 so way before Oct 21. (I did not know there were > different snapshots of the releases, I'm just a user trying to help :) ) 13.2.1 (and