[Bug libstdc++/101960] std::tuple with an array element is rejected as a named return type

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 19 12:03:09 GMT 2021


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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0187e0d7360f327f88d8b2294668669306ae4630

commit r12-3022-g0187e0d7360f327f88d8b2294668669306ae4630
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Aug 19 11:48:40 2021 +0100

    libstdc++: Fix move construction of std::tuple with array elements
[PR101960]

    An array member cannot be direct-initialized in a ctor-initializer-list,
    so use the base class' move constructor, which does the right thing for
    both arrays and non-arrays.

    This constructor could be defaulted, but that would make it trivial for
    some specializations, which would change the argument passing ABI. Do
    that for the versioned namespace only.

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/101960
            * include/std/tuple (_Tuple_impl(_Tuple_impl&&)): Use base
            class' move constructor. Define as defaulted for versioned
            namespace.
            * testsuite/20_util/tuple/cons/101960.cc: New test.


More information about the Gcc-bugs mailing list