]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix move construction of std::tuple with array elements [PR101960]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 12 Oct 2021 14:09:50 +0000 (15:09 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 12 Oct 2021 15:53:56 +0000 (16:53 +0100)
commite748216c237cff2915390e9653de2db63b2161ac
treec344931ff02759ec034a7d8a173c00ab16ea5d78
parent7b4e6d75b18dbb52bf507dbfd4c8e694e476d2af
libstdc++: Fix move construction of std::tuple with array elements [PR101960]

The r12-3022 commit only fixed the case where an array is the last
element of the tuple. This fixes the other cases too. We can just define
the move constructor as defaulted, which does the right thing. Changing
the move constructor to be trivial would be an ABI break, but since the
last base class still has a non-trivial move constructor, defining the
derived ones as defaulted doesn't change anything.

libstdc++-v3/ChangeLog:

PR libstdc++/101960
* include/std/tuple (_Tuple_impl(_Tuple_impl&&)): Define as
defauled.
* testsuite/20_util/tuple/cons/101960.cc: Check tuples with
array elements before the last element.

(cherry picked from commit 7481021364e75ba583972e15ed421a53988368ea)
libstdc++-v3/include/std/tuple
libstdc++-v3/testsuite/20_util/tuple/cons/101960.cc