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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tomasz Kaminski <tkami...@gcc.gnu.org>:

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

commit r16-1051-ga2e1c97205063d7550d9b9c32319715961abd73f
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue May 27 11:38:41 2025 +0200

    libstdc++: Implement C++26 std::polymorphic [PR119152]

    This patch implements C++26 std::polymorphic as specified in P3019 with
    amendment to move assignment from LWG 4251.

    The implementation always allocate stored object on the heap. The manager
    function (_M_manager) is similary keep with the object (polymorphic::_Obj),
    which reduces the size of the polymorphic to size of the single pointer
plus
    allocator (that is declared with [[no_unique_address]]).

    The implementation does not not use small-object optimization (SSO). We may
    consider adding this in the future, as SSO is allowed by the standard.
However,
    storing any polimorphic object will require providing space for two
pointers
    (manager function and vtable pointer) and user-declared data members.

            PR libstdc++/119152

    libstdc++-v3/ChangeLog:

            * include/bits/indirect.h (std::polymorphic, pmr::polymorphic)
            [__glibcxx_polymorphic]: Define.
            * include/bits/version.def (polymorphic): Define.
            * include/bits/version.h: Regenerate.
            * include/std/memory: Define __cpp_lib_polymorphic.
            * testsuite/std/memory/polymorphic/copy.cc: New test.
            * testsuite/std/memory/polymorphic/copy_alloc.cc: New test.
            * testsuite/std/memory/polymorphic/ctor.cc: New test.
            * testsuite/std/memory/polymorphic/ctor_poly.cc: New test.
            * testsuite/std/memory/polymorphic/incomplete.cc: New test.
            * testsuite/std/memory/polymorphic/invalid_neg.cc: New test.
            * testsuite/std/memory/polymorphic/move.cc: New test.
            * testsuite/std/memory/polymorphic/move_alloc.cc: New test.

    Co-authored-by: Tomasz KamiÅski <tkami...@redhat.com>
    Signed-off-by: Tomasz KamiÅski <tkami...@redhat.com>

Reply via email to