]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Correct value of __cpp_lib_constexpr_exceptions [PR117785]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 11 Jul 2025 22:49:27 +0000 (23:49 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 14 Jul 2025 11:53:22 +0000 (12:53 +0100)
Only P3068R6 (Allowing exception throwing in constant-evaluation) is
implemented in the library so far, so the value of the
constexpr_exceptions feature test macro should be 202411L. Once we
support the library changes in P3378R2 (constexpr exception types) then
we can set the value to 202502L again.

libstdc++-v3/ChangeLog:

PR libstdc++/117785
* include/bits/version.def (constexpr_exceptions): Define
correct value.
* include/bits/version.h: Regenerate.
* libsupc++/exception: Check correct value.
* testsuite/18_support/exception/version.cc: New test.

libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/libsupc++/exception
libstdc++-v3/testsuite/18_support/exception/version.cc [new file with mode: 0644]

index df58e7018d81cf53c875bc9d4da34d1f484a290b..cf0672b48224b3c7bb8ff0bf621bcc3d4b2d9e5f 100644 (file)
@@ -2053,7 +2053,7 @@ ftms = {
 ftms = {
   name = constexpr_exceptions;
   values = {
-    v = 202502;
+    v = 202411;
     cxxmin = 26;
     extra_cond = "__cpp_constexpr_exceptions >= 202411L";
   };
index 1414dd78ddab9c636590ab7f0de42ba80cbe9d1b..c01ddf14dd57623bc5af5f6911dedae6a72f7054 100644 (file)
 
 #if !defined(__cpp_lib_constexpr_exceptions)
 # if (__cplusplus >  202302L) && (__cpp_constexpr_exceptions >= 202411L)
-#  define __glibcxx_constexpr_exceptions 202502L
+#  define __glibcxx_constexpr_exceptions 202411L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constexpr_exceptions)
-#   define __cpp_lib_constexpr_exceptions 202502L
+#   define __cpp_lib_constexpr_exceptions 202411L
 #  endif
 # endif
 #endif /* !defined(__cpp_lib_constexpr_exceptions) && defined(__glibcxx_want_constexpr_exceptions) */
index 25ce8d97e3156d379094677262bd7400501c10b2..fc6f8d927711e877e563c3dfc3f9473bf898cf3a 100644 (file)
@@ -38,6 +38,7 @@
 #include <bits/exception.h>
 
 #define __glibcxx_want_uncaught_exceptions
+#define __glibcxx_want_constexpr_exceptions
 #define __glibcxx_want_exception_ptr_cast
 #include <bits/version.h>
 
diff --git a/libstdc++-v3/testsuite/18_support/exception/version.cc b/libstdc++-v3/testsuite/18_support/exception/version.cc
new file mode 100644 (file)
index 0000000..09a2d10
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do preprocess { target c++26 } }
+// { dg-add-options no_pch }
+
+#include <exception>
+
+#ifndef __cpp_lib_constexpr_exceptions
+# error "Feature test macro for constexpr_exceptions is missing in <exception>"
+#elif __cpp_lib_constexpr_exceptions < 202411L
+# error "Feature test macro for constexpr_exceptions has wrong value in <exception>"
+#endif