]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: no_unique_address and constexpr [PR112439]
authorJason Merrill <jason@redhat.com>
Thu, 1 Feb 2024 22:23:53 +0000 (17:23 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 2 Feb 2024 10:16:48 +0000 (05:16 -0500)
commit8bae2c531d2ea8f7872ed41f273b6fabaa6a9965
tree11ef86408ab313e317bef64b7914723025d877ea
parent6ae5912fe01390016da9027ff724db77b1c96bf3
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.

(cherry picked from commit f4998609908e4926fc095ce97cb84b187294fd1d)
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/cpp2a/no_unique_address15.C [new file with mode: 0644]