c++: no_unique_address and constexpr [PR112439]
commitf4998609908e4926fc095ce97cb84b187294fd1d
authorJason Merrill <jason@redhat.com>
Thu, 1 Feb 2024 22:23:53 +0000 (1 17:23 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 2 Feb 2024 03:22:06 +0000 (1 22:22 -0500)
treedbb5fc97845831fc32c5fbe38da794a9d77a340f
parent0b786ff38ab398087820d91241e030a28c451df9
c++: no_unique_address and constexpr [PR112439]

Here, because we don't build a CONSTRUCTOR for an empty base, we were
wrongly marking the Foo CONSTRUCTOR as complete after initializing the Empty
member.  Fixed by checking empty_base here as well.

PR c++/112439

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_store_expression): Check empty_base
before marking a CONSTRUCTOR readonly.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/no_unique_address15.C: New test.
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/cpp2a/no_unique_address15.C [new file with mode: 0644]