* include/debug/array (swap): Add deleted overload.
* include/bits/stl_pair.h (swap): Remove redundant inline keyword
from deleted overload.
* include/bits/unique_ptr.h (swap): Likewise.
* include/std/array (swap): Likewise.
* include/std/optional (swap): Likewise.
* include/std/tuple (swap): Likewise.
* include/std/variant (swap): Likewise.
* testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Likewise.
* testsuite/23_containers/array/tuple_interface/
tuple_element_debug_neg.cc: Likewise.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Likewise.
From-SVN: r243437
2016-12-08 Jonathan Wakely <jwakely@redhat.com>
+ * include/debug/array (swap): Add deleted overload.
+ * include/bits/stl_pair.h (swap): Remove redundant inline keyword
+ from deleted overload.
+ * include/bits/unique_ptr.h (swap): Likewise.
+ * include/std/array (swap): Likewise.
+ * include/std/optional (swap): Likewise.
+ * include/std/tuple (swap): Likewise.
+ * include/std/variant (swap): Likewise.
+ * testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
+ Adjust dg-error line numbers.
+ * testsuite/23_containers/array/tuple_interface/get_neg.cc: Likewise.
+ * testsuite/23_containers/array/tuple_interface/
+ tuple_element_debug_neg.cc: Likewise.
+ * testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
+ Likewise.
+
PR libstdc++/71856
* doc/xml/manual/using.xml: Document macro.
* include/bits/c++config [_GLIBCXX_DEBUG || _GLIBCXX_PARALLEL]
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
template<typename _T1, typename _T2>
- inline
typename enable_if<!__and_<__is_swappable<_T1>,
__is_swappable<_T2>>::value>::type
swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
template<typename _Tp, typename _Dp>
- inline
typename enable_if<!__is_swappable<_Dp>::value>::type
swap(unique_ptr<_Tp, _Dp>&,
unique_ptr<_Tp, _Dp>&) = delete;
{ return !(__one < __two); }
// Specialized algorithms.
+
+#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
+ template<typename _Tp, size_t _Nm>
+ typename enable_if<
+ !_GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::_Is_swappable::value>::type
+ swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&) = delete;
+#endif
+
template<typename _Tp, std::size_t _Nm>
inline void
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
template<typename _Tp, std::size_t _Nm>
- inline
typename enable_if<
!_GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::_Is_swappable::value>::type
swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&) = delete;
{ __lhs.swap(__rhs); }
template<typename _Tp>
- inline enable_if_t<!(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>)>
+ enable_if_t<!(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>)>
swap(optional<_Tp>&, optional<_Tp>&) = delete;
template<typename _Tp>
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
template<typename... _Elements>
- inline
typename enable_if<!__and_<__is_swappable<_Elements>...>::value>::type
swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete;
#endif
{ __lhs.swap(__rhs); }
template<typename... _Types>
- inline enable_if_t<!__and_<is_move_constructible<_Types>...,
- is_swappable<_Types>...>::value>
+ enable_if_t<!__and_<is_move_constructible<_Types>...,
+ is_swappable<_Types>...>::value>
swap(variant<_Types...>&, variant<_Types...>&) = delete;
class bad_variant_access : public exception
int n2 = std::get<1>(std::move(a));
int n3 = std::get<1>(ca);
-// { dg-error "static assertion failed" "" { target *-*-* } 273 }
-// { dg-error "static assertion failed" "" { target *-*-* } 282 }
+// { dg-error "static assertion failed" "" { target *-*-* } 281 }
// { dg-error "static assertion failed" "" { target *-*-* } 290 }
+// { dg-error "static assertion failed" "" { target *-*-* } 298 }
int n2 = std::get<1>(std::move(a));
int n3 = std::get<1>(ca);
-// { dg-error "static assertion failed" "" { target *-*-* } 303 }
-// { dg-error "static assertion failed" "" { target *-*-* } 312 }
-// { dg-error "static assertion failed" "" { target *-*-* } 320 }
+// { dg-error "static assertion failed" "" { target *-*-* } 302 }
+// { dg-error "static assertion failed" "" { target *-*-* } 311 }
+// { dg-error "static assertion failed" "" { target *-*-* } 319 }
typedef std::tuple_element<1, std::array<int, 1>>::type type;
-// { dg-error "static assertion failed" "" { target *-*-* } 308 }
+// { dg-error "static assertion failed" "" { target *-*-* } 316 }
typedef std::tuple_element<1, std::array<int, 1>>::type type;
-// { dg-error "static assertion failed" "" { target *-*-* } 351 }
+// { dg-error "static assertion failed" "" { target *-*-* } 350 }