c++: Fix [[no_unique_address]] and default mem-init [PR90432]
authorJason Merrill <jason@redhat.com>
Wed, 4 Mar 2020 17:08:42 +0000 (12:08 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 4 Mar 2020 22:32:10 +0000 (17:32 -0500)
commit6876b269bc7fe6465fedfed87c31e6175992129f
tree932e196928b06bdf75240404f18593556310a575
parent10bbbb591cfe6cac200e926a73f3b8065147ce84
c++: Fix [[no_unique_address]] and default mem-init [PR90432]

output_constructor doesn't like two consecutive entries with fields at the
same position; let's avoid adding the one for the empty field.

gcc/cp/ChangeLog
2020-03-04  Jason Merrill  <jason@redhat.com>

PR c++/90432
* init.c (perform_member_init): Don't do aggregate initialization of
empty field.
* constexpr.c (cx_check_missing_mem_inits): Don't enforce
initialization of empty field.
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/init.c
gcc/testsuite/g++.dg/cpp2a/no_unique_address3.C [new file with mode: 0644]