]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Do not define __cpp_lib_constexpr_exceptions [PR121114]
authorTomasz Kamiński <tkaminsk@redhat.com>
Wed, 16 Jul 2025 08:49:48 +0000 (10:49 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Wed, 16 Jul 2025 10:50:03 +0000 (12:50 +0200)
Do not advertise library support for constexpr exceptions, as our
solution to throwing by __throw_* functions from <bits/functexcept.h>,
caues constant evaluation to fail, as these functions are not constexpr.

PR libstdc++/121114

libstdc++-v3/ChangeLog:

* include/bits/version.def (constexpr_exceptions): Add no_stdname
and changed value.
* include/bits/version.h: Regenerated.
* testsuite/18_support/exception/version.cc: Test that macro is
not exported.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kaminski <tkaminsk@redhat.com>
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/testsuite/18_support/exception/version.cc

index cf0672b48224b3c7bb8ff0bf621bcc3d4b2d9e5f..2f70a5299275206a894fbc096632683b350b064c 100644 (file)
@@ -2052,8 +2052,10 @@ ftms = {
 
 ftms = {
   name = constexpr_exceptions;
+  // TODO Remove when PR121114 is resolved
+  no_stdname = true;
   values = {
-    v = 202411;
+    v = 1; // TODO 202411;
     cxxmin = 26;
     extra_cond = "__cpp_constexpr_exceptions >= 202411L";
   };
index c01ddf14dd57623bc5af5f6911dedae6a72f7054..8e0ae6822519fb7ae0972bfbd3d07986d046cb1e 100644 (file)
 
 #if !defined(__cpp_lib_constexpr_exceptions)
 # if (__cplusplus >  202302L) && (__cpp_constexpr_exceptions >= 202411L)
-#  define __glibcxx_constexpr_exceptions 202411L
+#  define __glibcxx_constexpr_exceptions 1L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_constexpr_exceptions)
-#   define __cpp_lib_constexpr_exceptions 202411L
 #  endif
 # endif
 #endif /* !defined(__cpp_lib_constexpr_exceptions) && defined(__glibcxx_want_constexpr_exceptions) */
index 09a2d102b7209d525dee351bcf0a3f09e12d5da6..5707abd732f500b491ff59e23ac68b376db1dc36 100644 (file)
@@ -3,8 +3,7 @@
 
 #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>"
+#ifdef __cpp_lib_constexpr_exceptions
+# error "Feature test macro for constexpr_exceptions should not be provided by <exception>"
 #endif
+