]> gcc.gnu.org Git - gcc.git/commit
c++: constexpr empty aggr [PR105795]
authorJason Merrill <jason@redhat.com>
Wed, 1 Jun 2022 20:13:48 +0000 (16:13 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 3 Jun 2022 04:38:22 +0000 (00:38 -0400)
commit340c53bc6352d223f543faac71996a3fa87d9119
treee6aeb543c861726a83e21e4d1e37b2202701bbf6
parent462e7e2c6fe0bc57e03110d43a2c7e53a1ce04ea
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.c (cxx_eval_bare_aggregate): Always call
init_subob_ctx.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-aggr-base1.C: New test.
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp1z/constexpr-aggr-base1.C [new file with mode: 0644]
This page took 0.061172 seconds and 6 git commands to generate.