https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110197

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Patrick Palka
<ppa...@gcc.gnu.org>:

https://gcc.gnu.org/g:61d24d3f40638326b4a24baadeb25a88610d76d8

commit r13-7693-g61d24d3f40638326b4a24baadeb25a88610d76d8
Author: Patrick Palka <ppa...@redhat.com>
Date:   Thu Jul 27 09:10:07 2023 -0400

    c++: constexpr empty subobject elision [PR110197]

    Now that init_subob_ctx no longer sets new_ctx.ctor for a subobject of
    empty type, it seems we need to ensure its callers also consistently
    omit entries in the parent ctx->ctor for such subobjects.  We also need
    to allow cxx_eval_array_reference to synthesize an empty subobject even
    if the array CONSTRUCTOR has CONSTRUCTOR_NO_CLEARING set.

            PR c++/110197

    gcc/cp/ChangeLog:

            * constexpr.cc (cxx_eval_array_reference): Allow synthesizing an
            empty subobject even if CONSTRUCTOR_NO_CLEARING is set.
            (cxx_eval_bare_aggregate): Set 'no_slot' to true more generally
            whenever new_ctx.ctor is set to NULL_TREE by init_subob_ctx,
            i.e. whenever initializing an subobject of empty type.
            (cxx_eval_vec_init_1): Define 'no_slot' as above and use it
            accordingly.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/constexpr-empty18.C: New test.
            * g++.dg/cpp0x/constexpr-empty19.C: New test.

    (cherry picked from commit a426b91b27e28985f47d16827a532fbc28c09bd7)

Reply via email to