]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add some missing ranges feature-test macro tests
authorPatrick Palka <ppalka@redhat.com>
Thu, 22 Aug 2024 15:25:10 +0000 (11:25 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 22 Oct 2024 01:38:40 +0000 (21:38 -0400)
libstdc++-v3/ChangeLog:

* testsuite/25_algorithms/contains/1.cc: Verify value of
__cpp_lib_ranges_contains.
* testsuite/25_algorithms/find_last/1.cc: Verify value of
__cpp_lib_ranges_find_last.
* testsuite/25_algorithms/iota/1.cc: Verify value of
__cpp_lib_ranges_iota.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 8e0da56f18b3678beee9d2bae27e08a0e122573a)

libstdc++-v3/testsuite/25_algorithms/contains/1.cc
libstdc++-v3/testsuite/25_algorithms/find_last/1.cc
libstdc++-v3/testsuite/25_algorithms/iota/1.cc

index 7d3fa048ef6118fd71ba5f2f6960f6ad64b8df4a..b44c06032e8ade185db43f96641706e12d4bc171 100644 (file)
@@ -4,6 +4,10 @@
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
+#if __cpp_lib_ranges_contains != 202207L
+# error "Feature-test macro __cpp_lib_ranges_contains has wrong value in <algorithm>"
+#endif
+
 namespace ranges = std::ranges;
 
 void
index 911e22887d1d86f79eeaf898ad1908ccce6d7d69..8a40bb1a6b36d4b3220c8f227208d7df4c93b6dc 100644 (file)
@@ -4,6 +4,10 @@
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
+#if __cpp_lib_ranges_find_last != 202207L
+# error "Feature-test macro __cpp_lib_ranges_find_last has wrong value in <algorithm>"
+#endif
+
 namespace ranges = std::ranges;
 
 constexpr bool
index 61bf418b4dae4ac329265725d6ea363fb95e7f14..ebadeee79a1324a68f92a150b11310339e0f0f47 100644 (file)
@@ -1,9 +1,14 @@
 // { dg-do run { target c++23 } }
 
 #include <algorithm>
+#include <numeric>
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
+#if __cpp_lib_ranges_iota != 202202L
+# error "Feature-test macro __cpp_lib_ranges_iota has wrong value in <numeric>"
+#endif
+
 namespace ranges = std::ranges;
 
 void