On Wed, 16 Jul 2025 at 10:54, Tomasz Kamiński <tkami...@redhat.com> wrote:
>
> 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.
> ---
> Tested on x86_64-linux locally. OK for trunk?
>
>  libstdc++-v3/include/bits/version.def                  | 6 ++++--
>  libstdc++-v3/include/bits/version.h                    | 3 +--
>  libstdc++-v3/testsuite/18_support/exception/version.cc | 7 +++----
>  3 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/libstdc++-v3/include/bits/version.def 
> b/libstdc++-v3/include/bits/version.def
> index cf0672b4822..addc60f27f3 100644
> --- a/libstdc++-v3/include/bits/version.def
> +++ b/libstdc++-v3/include/bits/version.def
> @@ -2051,9 +2051,11 @@ ftms = {
>  };
>
>  ftms = {
> -  name = constexpr_exceptions;
> +  name =  constexpr_exceptions;

It looks like the line above has an unnecessary space added.

OK for trunk without that, thanks.

> +  // TODO Remove when PR121114 is resolved
> +  no_stdname = true;
>    values = {
> -    v = 202411;
> +    v = 1; // TODO 202411;
>      cxxmin = 26;
>      extra_cond = "__cpp_constexpr_exceptions >= 202411L";
>    };
> diff --git a/libstdc++-v3/include/bits/version.h 
> b/libstdc++-v3/include/bits/version.h
> index c01ddf14dd5..8e0ae682251 100644
> --- a/libstdc++-v3/include/bits/version.h
> +++ b/libstdc++-v3/include/bits/version.h
> @@ -2301,9 +2301,8 @@
>
>  #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) */
> diff --git a/libstdc++-v3/testsuite/18_support/exception/version.cc 
> b/libstdc++-v3/testsuite/18_support/exception/version.cc
> index 09a2d102b72..5707abd732f 100644
> --- a/libstdc++-v3/testsuite/18_support/exception/version.cc
> +++ b/libstdc++-v3/testsuite/18_support/exception/version.cc
> @@ -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
> +
> --
> 2.49.0
>

Reply via email to