c++: defaulted ctor with DMI in union [PR94823]
commitdf118d7ba138cacb17203d4a1b5f27730347cc77
authorJason Merrill <jason@redhat.com>
Wed, 20 Jul 2022 22:15:31 +0000 (20 18:15 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 21 Jul 2022 21:21:17 +0000 (21 17:21 -0400)
tree2bc6c1de497c59f06d877c77656ee3973c7266e3
parent142e6af6959cba0d4dfd5cba6c4f16e15d154156
c++: defaulted ctor with DMI in union [PR94823]

CWG2084 clarifies that a variant member with a non-trivial constructor does
not make the union's defaulted default constructor deleted if another
variant member has a default member initializer.

DR 2084
PR c++/94823

gcc/cp/ChangeLog:

* method.cc (walk_field_subobs): Fix DMI in union case.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/nsdmi-union7.C: New test.
gcc/cp/method.cc
gcc/testsuite/g++.dg/cpp0x/nsdmi-union7.C [new file with mode: 0644]