[Bug c++/98994] [11 Regression] Empty type with [[no_unique_address]] in union with constructor is not a constant expression since r11-6918

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 9 01:52:34 GMT 2021


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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:a8dd2b3e96590ceccead63d28fc91c956a5f1a73

commit r11-7141-ga8dd2b3e96590ceccead63d28fc91c956a5f1a73
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Feb 8 15:56:11 2021 -0500

    c++: constexpr, union, and no_unique_address [PR98994]

    My second patch for 97566 omits nested CONSTRUCTORs for empty fields, but
we
    do want them for empty union members.

    gcc/cp/ChangeLog:

            PR c++/98994
            PR c++/97566
            * constexpr.c (cxx_eval_store_expression): Only skip empty fields
in
            RECORD_TYPE.

    gcc/testsuite/ChangeLog:

            PR c++/98994
            * g++.dg/cpp2a/no_unique_address12.C: New test.


More information about the Gcc-bugs mailing list