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

--- Comment #24 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tomasz Kaminski <[email protected]>:

https://gcc.gnu.org/g:a6cb4f459e781eb066290f3bbcd0569901e372b1

commit r17-4164-ga6cb4f459e781eb066290f3bbcd0569901e372b1
Author: Tomasz KamiÅski <[email protected]>
Date:   Fri Sep 11 10:23:33 2026 +0200

    libstdc++: Expand constexpr support for inplace_vector per P3726R2
[PR125845, PR124121].

    This implements remaining part of the P3726R2, "Adjustments to Union
    Lifetime Rules", by using std::start_lifetime in inplace_vector::_M_init.

    The alternative branch no longer uses std::start_lifetime_as, that was
    preventing optimizations (see PR124121), it is not required as GCC treats
    any write to union as potentially changing active member. Furthermore when
    available __builtin_constexpr_diag is used to emit better error message.
    TODO comment is also removed, as suggested new call is not supported until
    clang 23.

    libstdc++-v3/ChangeLog:

            PR libstdc++/125845
            PR libstdc++/124121
            * include/bits/version.def (start_lifetime): Move before
            inplace_vector.
            (constexpr_inplace_vector): Define.
            * include/bits/version.h: Regenerate.
            * include/std/inplace_vector (__cpp_lib_constexpr_inplace_vector):
            Define.
            (inplace_vector::_M_init): Use std::start_lifetime instead of
            std::start_lifetime_as, when available. Emit error using
            __builtin_constexpr_diag.
            * testsuite/23_containers/inplace_vector/cons/1.cc: Enable and
            andd compile time tests for non-trivial types.
            * testsuite/23_containers/inplace_vector/copy.cc: Likewise.
            * testsuite/23_containers/inplace_vector/modifiers/assign.cc:
            Likewise.
            * testsuite/23_containers/inplace_vector/modifiers/erase.cc:
            Likewise.
            * testsuite/23_containers/inplace_vector/modifiers/multi_insert.cc:
            Likewise.
            *
testsuite/23_containers/inplace_vector/modifiers/single_insert.cc:
            Likewise.
            * testsuite/23_containers/inplace_vector/move.cc: Likewise.
            * testsuite/23_containers/inplace_vector/version.cc: Test value of
            __cpp_lib_constexpr_inplace_vector.

Reply via email to