https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105795
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:7a4b608b31af3824d615cd490f855e3730d217b4 commit r12-8455-g7a4b608b31af3824d615cd490f855e3730d217b4 Author: Jason Merrill <ja...@redhat.com> Date: Wed Jun 1 16:13:48 2022 -0400 c++: constexpr empty aggr [PR105795] In this testcase, leaving ctx->ctor pointing to the enclosing object meant that evaluating the initializer for the subobject clobbered previous initializers for the enclosing object. So do update ctx->ctor, just don't add it to the enclosing object ctor. PR c++/105795 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_bare_aggregate): Always call init_subob_ctx. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/constexpr-aggr-base1.C: New test.