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

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

https://gcc.gnu.org/g:5154144864a669c722fbb2170e79416c3ae5ff50

commit r17-377-g5154144864a669c722fbb2170e79416c3ae5ff50
Author: Jonathan Wakely <[email protected]>
Date:   Wed Apr 22 15:37:16 2026 +0100

    libstdc++: Constrain tuple(tuple&&) [PR78302]

    Since C++20 the std::tuple move constructor should be constrained (as
    modified by LWG 2899).

    We already define the move constructor as defaulted, but it's not
    implicitly defined as deleted for non-move-constructible element types
    because the _Tuple_impl(_Tuple_impl&&) constructor is user-provided and
    unconstrained. For C++20 and later we use a requires-clause to constrain
    the defaulted tuple(tuple&&) constructor.

    Ideally we'd make this change pre-C++20 as well, but that's harder to do
    without using a requires-clause, so this change is only for C++20 and
    later. I think that's OK, but if we need to change it for pre-C++20
    later we can consider inheriting from _Enable_copy_move<..., tuple> to
    make the defaulted move constructor defined as deleted.

    libstdc++-v3/ChangeLog:

            PR libstdc++/78302
            PR libstdc++/71301
            * include/std/tuple [C++20] (tuple(tuple&&)): Add
            requires-clause.
            * testsuite/20_util/tuple/cons/78302.cc: New test.

    Reviewed-by: Tomasz KamiÅski <[email protected]>

Reply via email to