The alloc_ptr.cc test for std::set tries to use C++17 features
unconditionally, and tries to use the C++23 range members which haven't
been implemented for std::set yet.

Some of the range checks are left in place but commented out, so they
can be added after the ranges members are implemented. Others (such as
prepend_range) are not valid for std::set at all.

Also fix uses of internal feature test macros in two other tests, which
should use the standard __cpp_lib_xxx macros.

libstdc++-v3/ChangeLog:

        * 
testsuite/23_containers/set/requirements/explicit_instantiation/alloc_ptr.cc:
        Guard node extraction checks with feature test macro. Remove
        calls to non-existent range members.
        * 
testsuite/23_containers/forward_list/requirements/explicit_instantiation/alloc_ptr.cc:
        Use standard macro not internal one.
        * 
testsuite/23_containers/list/requirements/explicit_instantiation/alloc_ptr.cc:
        Likewise.
---

Tested x86_64-linux. Pushed to trunk.

 .../requirements/explicit_instantiation/alloc_ptr.cc  |  2 +-
 .../requirements/explicit_instantiation/alloc_ptr.cc  |  2 +-
 .../requirements/explicit_instantiation/alloc_ptr.cc  | 11 +++++++----
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/alloc_ptr.cc
 
b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/alloc_ptr.cc
index e3bf8a13095a..08731f1bf38a 100644
--- 
a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/alloc_ptr.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/alloc_ptr.cc
@@ -87,7 +87,7 @@ test_template_members(__gnu_test::input_container<short>& c)
   l.merge(std::move(l), [](int, int) { return false; });
   l.sort([](int, int) { return false; });
 
-#ifdef __glibcxx_ranges_to_container
+#ifdef __cpp_lib_ranges_to_container
   short arr[2];
   __gnu_test::test_input_range<short> r(arr);
   std::forward_list<int, Allocator<int>> l2(std::from_range, r);
diff --git 
a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/alloc_ptr.cc
 
b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/alloc_ptr.cc
index c52591b3cf8b..36bd89efcdb3 100644
--- 
a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/alloc_ptr.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/alloc_ptr.cc
@@ -86,7 +86,7 @@ test_template_members(__gnu_test::input_container<short>& c)
   l.merge(std::move(l), [](int, int) { return false; });
   l.sort([](int, int) { return false; });
 
-#ifdef __glibcxx_ranges_to_container
+#ifdef __cpp_lib_ranges_to_container
   short arr[2];
   __gnu_test::test_input_range<short> r(arr);
   std::list<int, Allocator<int>> l2(std::from_range, r);
diff --git 
a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/alloc_ptr.cc
 
b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/alloc_ptr.cc
index 60b583a9b2be..4fa84a74882d 100644
--- 
a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/alloc_ptr.cc
+++ 
b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/alloc_ptr.cc
@@ -69,18 +69,21 @@ test_template_members(__gnu_test::input_container<short>& c)
   s.emplace_hint(s.begin(), 1);
   s.insert(c.begin(), c.end());
 
+#ifdef __cpp_lib_node_extract
   std::set<int, std::greater<int>, Allocator<int>> s1;
   s.merge(s1);
   std::multiset<int, std::greater<int>, Allocator<int>> m1;
   s.merge(m1);
+#endif
 
-#ifdef __glibcxx_ranges_to_container
+#if 0
+#ifdef __cpp_lib_ranges_to_container
   short arr[2];
   __gnu_test::test_input_range<short> r(arr);
   std::set<int, std::less<int>, Allocator<int>> s2(std::from_range, r);
-  s2.assign_range(r);
-  s2.prepend_range(r);
-  s2.append_range(r);
+  std::set<int, std::less<int>, Allocator<int>> s3(std::from_range, r,
+                                                  Allocator<int>{});
   s2.insert_range(s2.begin(), r);
 #endif
+#endif
 }
-- 
2.47.1

Reply via email to