https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97665

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You can do Foo foo = Foo(); and it compiles.  clang++ rejects it too:
error: constexpr union constructor that does not initialize any member is a
C++20 extension [-Werror,-Wc++20-extensions]
though only with -pedantic-errors.

But g++ rejects it even in -std=c++20 mode:
pr97665.C:15:13: error: ‘V{U [1]{U()}}’ is not a constant expression
   15 | constexpr V v;
      |             ^
pr97665.C:15:13: error: ‘V()’ is not a constant expression because it refers to
an incompletely initialized variable

Reply via email to