[Bug libstdc++/103879] error: accessing value of variant::_Copy_ctor_base through a 'const variant' glvalue in a constant expression

2022-01-03 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103879 Patrick Palka changed: What|Removed |Added Ever confirmed|0 |1 CC|

[Bug libstdc++/103879] error: accessing value of variant::_Copy_ctor_base through a 'const variant' glvalue in a constant expression

2022-01-01 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103879 --- Comment #4 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #1) > clang rejects it also (with their libc++): Libc++ doesn't support constexpr std::string, and I think it's missing some DRs to std::variant as well. So I would

[Bug libstdc++/103879] error: accessing value of variant::_Copy_ctor_base through a 'const variant' glvalue in a constant expression

2021-12-31 Thread lhlaurini at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103879 Luiz Henrique Laurini changed: What|Removed |Added CC||lhlaurini at hotmail dot com --

[Bug libstdc++/103879] error: accessing value of variant::_Copy_ctor_base through a 'const variant' glvalue in a constant expression

2021-12-31 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103879 --- Comment #2 from Andrew Pinski --- MSVC also rejects it: example.cpp (14): error C2131: expression did not evaluate to a constant (10): note: failure was caused by call of undefined function or one not declared 'constexpr' (10): note: see usa

[Bug libstdc++/103879] error: accessing value of variant::_Copy_ctor_base through a 'const variant' glvalue in a constant expression

2021-12-31 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103879 --- Comment #1 from Andrew Pinski --- clang rejects it also (with their libc++): :10:5: error: variable of non-literal type 'S' cannot be defined in a constexpr function S s{"str"}; ^ :6:29: note: 'S' is not literal because it has data me