#endif // C++23
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2766. Swapping non-swappable types
template<typename _T1, typename _T2>
typename enable_if<!__and_<__is_swappable<_T1>,
__is_swappable<_T2>>::value>::type
{ __x.swap(__y); }
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2766. Swapping non-swappable types
template<typename _Tp, typename _Dp>
typename enable_if<!__is_swappable<_Dp>::value>::type
swap(unique_ptr<_Tp, _Dp>&,
{ __one.swap(__two); }
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2766. Swapping non-swappable types
template<typename _Tp, std::size_t _Nm>
__enable_if_t<!__array_traits<_Tp, _Nm>::_Is_swappable::value>
swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&) = delete;
noexcept(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2766. Swapping non-swappable types
template<typename _Tp>
enable_if_t<!(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>)>
swap(optional<_Tp>&, optional<_Tp>&) = delete;
{ __x.swap(__y); }
#if __cpp_lib_ranges_zip // >= C++23
+ /// Exchange the values of two const tuples (if const elements can be swapped)
template<typename... _Elements>
requires (is_swappable_v<const _Elements> && ...)
constexpr void
#endif // C++23
#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
- /// Exchange the values of two const tuples (if const elements can be swapped)
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2766. Swapping non-swappable types
template<typename... _Elements>
_GLIBCXX20_CONSTEXPR
typename enable_if<!__and_<__is_swappable<_Elements>...>::value>::type
noexcept(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2766. Swapping non-swappable types
template<typename... _Types>
enable_if_t<!((is_move_constructible_v<_Types> && ...)
&& (is_swappable_v<_Types> && ...))>
int n2 = std::get<1>(std::move(a));
int n3 = std::get<1>(ca);
-// { dg-error "static assertion failed" "" { target *-*-* } 394 }
-// { dg-error "static assertion failed" "" { target *-*-* } 403 }
-// { dg-error "static assertion failed" "" { target *-*-* } 412 }
+// { dg-error "static assertion failed" "" { target *-*-* } 396 }
+// { dg-error "static assertion failed" "" { target *-*-* } 405 }
+// { dg-error "static assertion failed" "" { target *-*-* } 414 }