]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix fancy pointer test for std::set
authorJonathan Wakely <jwakely@redhat.com>
Wed, 15 Jan 2025 21:24:15 +0000 (21:24 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 15 Jan 2025 23:34:28 +0000 (23:34 +0000)
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.

libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/alloc_ptr.cc
libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/alloc_ptr.cc
libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/alloc_ptr.cc

index e3bf8a13095a97fc7eb7195b213be1819b21948e..08731f1bf38ae9bcc4f0fc4439f9df325d9a4b15 100644 (file)
@@ -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);
index c52591b3cf8be79c5c055ea70b51f0df922c4b3b..36bd89efcdb39a27ae60f518783d7b4aaab33311 100644 (file)
@@ -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);
index 60b583a9b2bed2f2190fb0ac959034b8f1f1a9b5..4fa84a74882da9ffeb271c5e9e09d7fea9ec2757 100644 (file)
@@ -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
 }