]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Adjust value of __cpp_lib_constrained_equality for C++20
authorJonathan Wakely <jwakely@redhat.com>
Thu, 10 Apr 2025 10:00:36 +0000 (11:00 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 10 Apr 2025 16:10:33 +0000 (17:10 +0100)
The P3379R0 bump to __cpp_lib_constrained_equality relates to changes
that only affect std::expected, so there's no reason to define the
updated value in C++20.

This change restores the previous value (202403) for C++20, and only
uses the new value (202411) for C++23 and later.

Also remove the TODO comments, because I correctly predicted that the
final value would be 202411.

libstdc++-v3/ChangeLog:

* include/bits/version.def (constrained_equality): Only define
as 202411 for C++23 and later, use 202403 for C++20.
* include/bits/version.h: Regenerate.
* testsuite/20_util/expected/equality_constrained.cc: Remove
TODO comment.

libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc

index 8f609b469cc954b84433c5c593fa9089b0c2ffe3..2ec1b40bd38fc5a432295ac3aaa738f2debd8a30 100644 (file)
@@ -1273,7 +1273,12 @@ ftms = {
 ftms = {
   name = constrained_equality;
   values = {
-    v = 202411; // FIXME: 202403 for P2944R3, ??? for P3379R0
+    v = 202411;
+    cxxmin = 23;
+    extra_cond = "__glibcxx_three_way_comparison";
+  };
+  values = {
+    v = 202403;
     cxxmin = 20;
     extra_cond = "__glibcxx_three_way_comparison";
   };
index f05c3fd13c0eab021520087f8ea6b9efda22a3db..04c1349c84bbbd1350e61c5653ed224a5530b9bc 100644 (file)
 #undef __glibcxx_want_constexpr_vector
 
 #if !defined(__cpp_lib_constrained_equality)
-# if (__cplusplus >= 202002L) && (__glibcxx_three_way_comparison)
+# if (__cplusplus >= 202100L) && (__glibcxx_three_way_comparison)
 #  define __glibcxx_constrained_equality 202411L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constrained_equality)
 #   define __cpp_lib_constrained_equality 202411L
 #  endif
+# elif (__cplusplus >= 202002L) && (__glibcxx_three_way_comparison)
+#  define __glibcxx_constrained_equality 202403L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constrained_equality)
+#   define __cpp_lib_constrained_equality 202403L
+#  endif
 # endif
 #endif /* !defined(__cpp_lib_constrained_equality) && defined(__glibcxx_want_constrained_equality) */
 #undef __glibcxx_want_constrained_equality
index 7f6cefae7487da96924d67bc9d6bd863bb838196..a079d98129fd9a05e6d6d7e75b17ca8c31fe6eef 100644 (file)
@@ -4,7 +4,7 @@
 
 #ifndef __cpp_lib_constrained_equality
 # error "Feature-test macro for constrained_equality missing in <expected>"
-#elif __cpp_lib_constrained_equality < 202411L // TODO: use final value
+#elif __cpp_lib_constrained_equality < 202411L
 # error "Feature-test macro for constrained_equality has wrong value"
 #endif