c++: constexpr, union, and no_unique_address [PR98994]
authorJason Merrill <jason@redhat.com>
Mon, 8 Feb 2021 20:56:11 +0000 (15:56 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 9 Feb 2021 01:51:24 +0000 (20:51 -0500)
commita8dd2b3e96590ceccead63d28fc91c956a5f1a73
tree5801eaf989c4d925bf56699f2b665979cba8c835
parent2da7ce23cfd81b67f77dc102d6f97dd19363b5f4
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.
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp2a/no_unique_address12.C [new file with mode: 0644]