#if __cplusplus >= 201103L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2103. std::allocator propagate_on_container_move_assignment
- typedef true_type propagate_on_container_move_assignment;
+ using propagate_on_container_move_assignment = true_type;
- typedef true_type is_always_equal;
+ using is_always_equal
+ _GLIBCXX20_DEPRECATED_SUGGEST("allocator_traits::is_always_equal")
+ = true_type;
#if __cplusplus >= 202002L
allocator() = default;
#if __cplusplus >= 201103L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2103. std::allocator propagate_on_container_move_assignment
- typedef true_type propagate_on_container_move_assignment;
+ using propagate_on_container_move_assignment = true_type;
- typedef true_type is_always_equal;
+ using is_always_equal
+ _GLIBCXX20_DEPRECATED_SUGGEST("allocator_traits::is_always_equal")
+ = true_type;
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
: __detail::__cond_value_type<typename _Tp::value_type>
{ };
- // LWG 3446 doesn't add this, but it's needed for the case where
- // value_type and element_type are both present, but not the same type.
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 3541. indirectly_readable_traits should be SFINAE-friendly for all types
template<__detail::__has_member_value_type _Tp>
requires __detail::__has_member_element_type<_Tp>
struct indirectly_readable_traits<_Tp>
std::true_type>::value,
"propagate_on_container_move_assignment" );
-static_assert( is_same<allocator<int>::is_always_equal, std::true_type>::value,
- "is_always_equal" );
+using IAE = allocator<int>::is_always_equal; // { dg-warning "deprecated" "" { target c++20 } }
+static_assert( is_same<IAE, std::true_type>::value, "is_always_equal" );
+
+
+// Test required typedefs for allocator<void> specialization.
+static_assert( is_same<allocator<void>::value_type, void>::value,
+ "void value_type" );
+#if __cplusplus <= 201703L
+static_assert( is_same<allocator<void>::pointer, void*>::value,
+ "void pointer" );
+static_assert( is_same<allocator<void>::const_pointer, const void*>::value,
+ "void const_pointer" );
+static_assert( is_same<allocator<void>::rebind<char>::other,
+ allocator<char>>::value,
+ "void rebind::other" );
+#else
+// Since C++20 allocator<void> uses the primary template, so has the same types.
+static_assert( is_same<allocator<void>::propagate_on_container_move_assignment,
+ std::true_type>::value,
+ "propagate_on_container_move_assignment" );
+
+using VIAE = allocator<void>::is_always_equal; // { dg-warning "deprecated" "" { target c++20 } }
+static_assert( is_same<VIAE, std::true_type>::value, "is_always_equal" );
+#endif