aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-04-10 11:00:36 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2025-04-10 17:10:33 +0100
commitbb323ec8fdfce6dc22b1ca13a2c381f1496c545d (patch)
treeb3c940ab2bd756ce0d6d9c6ca4590e5df9e175cc
parent6fd19b2dbda453d3de57529ded2df9e62d1efdaa (diff)
downloadgcc-bb323ec8fdfce6dc22b1ca13a2c381f1496c545d.zip
gcc-bb323ec8fdfce6dc22b1ca13a2c381f1496c545d.tar.gz
gcc-bb323ec8fdfce6dc22b1ca13a2c381f1496c545d.tar.bz2
libstdc++: Adjust value of __cpp_lib_constrained_equality for C++20
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.
-rw-r--r--libstdc++-v3/include/bits/version.def7
-rw-r--r--libstdc++-v3/include/bits/version.h7
-rw-r--r--libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc2
3 files changed, 13 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def
index 8f609b4..2ec1b40 100644
--- a/libstdc++-v3/include/bits/version.def
+++ b/libstdc++-v3/include/bits/version.def
@@ -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";
};
diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h
index f05c3fd..04c1349 100644
--- a/libstdc++-v3/include/bits/version.h
+++ b/libstdc++-v3/include/bits/version.h
@@ -1406,11 +1406,16 @@
#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
diff --git a/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc b/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc
index 7f6cefa..a079d98 100644
--- a/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc
+++ b/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc
@@ -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