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.
// 2729. Missing SFINAE on std::pair::operator=
_Tuple_impl& operator=(const _Tuple_impl&) = delete;
+#if _GLIBCXX_INLINE_VERSION
+ _Tuple_impl(_Tuple_impl&&) = default;
+#else
constexpr
_Tuple_impl(_Tuple_impl&& __in)
noexcept(is_nothrow_move_constructible<_Head>::value)
- : _Base(std::forward<_Head>(_M_head(__in)))
+ : _Base(static_cast<_Base&&>(__in))
{ }
+#endif
template<typename _UHead>
constexpr
--- /dev/null
+// { dg-do compile { target c++11 } }
+#include <tuple>
+std::tuple<int[1]> t;
+auto tt = std::move(t); // PR libstdc++/101960