{
#if __cplusplus >= 201703L
using _P2 = remove_reference_t<_Pair>;
- if constexpr (__is_pair<_P2>)
+ if constexpr (__is_pair<remove_const_t<_P2>>)
if constexpr (is_same_v<allocator_type, allocator<value_type>>)
if constexpr (__usable_key<typename _P2::first_type>)
{
template<typename _Tp, typename _Up>
inline constexpr bool __is_pair<pair<_Tp, _Up>> = true;
-
- template<typename _Tp, typename _Up>
- inline constexpr bool __is_pair<const pair<_Tp, _Up>> = true;
#endif
/// @cond undocumented
--- /dev/null
+// { dg-options "-std=gnu++23" }
+// { dg-do run { target c++20 } }
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct UsesAlloc
+{
+ using allocator_type = std::allocator<int>;
+
+ bool passed_alloc;
+
+ UsesAlloc(int) : passed_alloc(false) { }
+
+ UsesAlloc(int, std::allocator<int>) : passed_alloc(true) { }
+};
+
+using Pair = std::pair<UsesAlloc, int>;
+
+void
+test_const()
+{
+ std::allocator<int> a;
+ int i = 0;
+ auto p = std::make_obj_using_allocator<const Pair>(a, i, i);
+ VERIFY( p.first.passed_alloc );
+}
+
+void
+test_volatile()
+{
+ std::allocator<int> a;
+ int i = 0;
+ auto p = std::make_obj_using_allocator<volatile Pair>(a, i, i);
+ VERIFY( p.first.passed_alloc );
+}
+
+void
+test_const_volatile()
+{
+ std::allocator<int> a;
+ int i = 0;
+ auto p = std::make_obj_using_allocator<volatile Pair>(a, i, i);
+ VERIFY( p.first.passed_alloc );
+}
+
+int main()
+{
+ test_const();
+ test_volatile();
+ test_const_volatile();
+}