bool = __empty_not_final<_Head>::value>
struct _Head_base;
+#if __has_cpp_attribute(no_unique_address)
+ template<size_t _Idx, typename _Head>
+ struct _Head_base<_Idx, _Head, true>
+ {
+ constexpr _Head_base()
+ : _M_head_impl() { }
+
+ constexpr _Head_base(const _Head& __h)
+ : _M_head_impl(__h) { }
+
+ constexpr _Head_base(const _Head_base&) = default;
+ constexpr _Head_base(_Head_base&&) = default;
+
+ template<typename _UHead>
+ constexpr _Head_base(_UHead&& __h)
+ : _M_head_impl(std::forward<_UHead>(__h)) { }
+
+ _GLIBCXX20_CONSTEXPR
+ _Head_base(allocator_arg_t, __uses_alloc0)
+ : _M_head_impl() { }
+
+ template<typename _Alloc>
+ _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a)
+ : _M_head_impl(allocator_arg, *__a._M_a) { }
+
+ template<typename _Alloc>
+ _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a)
+ : _M_head_impl(*__a._M_a) { }
+
+ template<typename _UHead>
+ _GLIBCXX20_CONSTEXPR
+ _Head_base(__uses_alloc0, _UHead&& __uhead)
+ : _M_head_impl(std::forward<_UHead>(__uhead)) { }
+
+ template<typename _Alloc, typename _UHead>
+ _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead)
+ : _M_head_impl(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead))
+ { }
+
+ template<typename _Alloc, typename _UHead>
+ _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead)
+ : _M_head_impl(std::forward<_UHead>(__uhead), *__a._M_a) { }
+
+ static constexpr _Head&
+ _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; }
+
+ static constexpr const _Head&
+ _M_head(const _Head_base& __b) noexcept { return __b._M_head_impl; }
+
+ [[no_unique_address]] _Head _M_head_impl;
+ };
+#else
template<size_t _Idx, typename _Head>
struct _Head_base<_Idx, _Head, true>
: public _Head
static constexpr const _Head&
_M_head(const _Head_base& __b) noexcept { return __b; }
};
+#endif
template<size_t _Idx, typename _Head>
struct _Head_base<_Idx, _Head, false>
--- /dev/null
+// Copyright (C) 2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile { target c++11 } }
+
+
+#include <tuple>
+
+struct A {
+ bool operator == (A) const { return true; }
+};
+
+struct B {
+ bool operator == (B) const { return true; }
+};
+
+using Tuple = std::tuple<A, B>;
+
+bool example(Tuple a, Tuple b)
+{
+ return a == b; // PR libstdc++/93147
+}
--- /dev/null
+// Copyright (C) 2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile { target c++11 } }
+
+#include <tuple>
+
+struct A { };
+
+void f(A);
+
+struct B { B(std::tuple<A>); };
+
+void f(B);
+
+void test01()
+{
+ f(std::make_tuple(A())); // PR libstdc++/55713
+}
--- /dev/null
+// Copyright (C) 2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile { target c++11 } }
+
+#include <tuple>
+
+struct A {};
+struct B : std::tuple<A> {};
+
+void
+test01()
+{
+ std::tuple<B> t;
+ std::get<0>(t); // PR libstdc++/71096
+}
// { dg-final { note-test t1 {empty std::tuple} } }
std::tuple<std::string, int, std::tuple<>> t2{ "Johnny", 5, {} };
-// { dg-final { regexp-test t2 {std::tuple containing = {\[1\] = "Johnny", \[2\] = 5, \[3\] = {<std::(__8::)?tuple<>> = empty std::tuple, <No data fields>}}} } }
+// { dg-final { regexp-test t2 {std::tuple containing = {\[1\] = "Johnny", \[2\] = 5, \[3\] = empty std::tuple}} } }
std::cout << "\n";
return 0; // Mark SPOT