@@ -95,9 +95,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// 2103. std::allocator propagate_on_container_move_assignment
using propagate_on_container_move_assignment = true_type;
+#if __cplusplus <= 202302L
using is_always_equal
_GLIBCXX20_DEPRECATED_SUGGEST("std::allocator_traits::is_always_equal")
= true_type;
+#endif
#if __cplusplus >= 202002L
// As noted above, these members are present for C++20 to provide the
@@ -152,9 +154,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// 2103. std::allocator propagate_on_container_move_assignment
using propagate_on_container_move_assignment = true_type;
+#if __cplusplus <= 202302L
using is_always_equal
_GLIBCXX20_DEPRECATED_SUGGEST("std::allocator_traits::is_always_equal")
= true_type;
+#endif
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -54,9 +54,13 @@ static_assert( is_same<allocator<int>::propagate_on_container_move_assignment,
std::true_type>::value,
"propagate_on_container_move_assignment" );
-using IAE = allocator<int>::is_always_equal; // { dg-warning "deprecated" "" { target c++20 } }
+#if __cplusplus <= 202302L
+using IAE = allocator<int>::is_always_equal; // { dg-warning "deprecated" "" { target { c++20_only || c++23_only } } }
static_assert( is_same<IAE, std::true_type>::value, "is_always_equal" );
-
+#else
+struct B { using is_always_equal = int; };
+struct tester : B, std::allocator<int> { is_always_equal unambig; };
+#endif
// Test required typedefs for allocator<void> specialization.
static_assert( is_same<allocator<void>::value_type, void>::value,
@@ -75,6 +79,10 @@ 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 } }
+#if __cplusplus <= 202302L
+using VIAE = allocator<void>::is_always_equal; // { dg-warning "deprecated" "" { target { c++20_only || c++23_only } } }
static_assert( is_same<VIAE, std::true_type>::value, "is_always_equal" );
+#else
+struct tester2 : B, std::allocator<void> { is_always_equal unambig; };
+#endif
#endif
@@ -36,8 +36,10 @@ test01()
static_assert( std::allocator<void>::propagate_on_container_move_assignment(),
"POCMA trait should always be present" );
+#if __cplusplus <= 202302L
static_assert( std::allocator<void>::is_always_equal(),
- "is_always_equal trait should always be present" );
+ "is_always_equal trait should be present before C++26" );
+#endif
static_assert(
std::is_same<std::allocator<void>::size_type, std::size_t>(),
@@ -14,6 +14,10 @@ struct Alloc : std::allocator<T>
template<typename U>
constexpr Alloc(const Alloc<U>& a) : personality(a.personality) { }
+#if __cplusplus <= 202302L
+ using is_always_equal = std::false_type;
+#endif
+
int personality = 0;
constexpr Alloc select_on_container_copy_construction() const
@@ -22,6 +22,10 @@ struct Alloc : std::allocator<T>
template<typename U>
constexpr Alloc(const Alloc<U>& a) : personality(a.personality) { }
+#if __cplusplus <= 202302L
+ using is_always_equal = std::false_type;
+#endif
+
int personality = 0;
constexpr Alloc select_on_container_copy_construction() const