[Bug c++/105795] [11/12 Regression] Miscompilation with [[no_unique_address]]

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 2 21:10:13 GMT 2022


--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill


commit r12-8455-g7a4b608b31af3824d615cd490f855e3730d217b4
Author: Jason Merrill <jason@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


            * constexpr.cc (cxx_eval_bare_aggregate): Always call


            * g++.dg/cpp1z/constexpr-aggr-base1.C: New test.

More information about the Gcc-bugs mailing list