[Bug c++/110245] constant evaluation fails with uninitialized union and default constructor

2023-06-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110245 --- Comment #2 from Andrew Pinski --- So if I read: https://cplusplus.github.io/CWG/issues/2558.html there is still an open question about "Union types shall be initialized such that they have an active member in the result of a constant express

[Bug c++/110245] constant evaluation fails with uninitialized union and default constructor

2023-06-13 Thread danakj at orodu dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110245 --- Comment #1 from danakj at orodu dot net --- Note that GCC has no problem with doing this constexpr construction if the object is not stored as an lvalue. ``` struct Store { constexpr Store() {} union { int i; }; bool