On Tue, 24 Feb 2026 at 17:07, Tomasz Kamiński <[email protected]> wrote:
>
> Do not test the exception at compile time if _GLIBCXX_USE_CXX11_ABI
> is not set, i.e. standard exceptions types are not supported.
>
> libstdc++-v3/ChangeLog:
>
> * testsuite/23_containers/mdspan/at.cc: Updated test.
> ---
> Tested on x86_64-linux. Pushed to trunk.
>
> libstdc++-v3/testsuite/23_containers/mdspan/at.cc | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/23_containers/mdspan/at.cc
> b/libstdc++-v3/testsuite/23_containers/mdspan/at.cc
> index 4e659f57275..d9edce464ad 100644
> --- a/libstdc++-v3/testsuite/23_containers/mdspan/at.cc
> +++ b/libstdc++-v3/testsuite/23_containers/mdspan/at.cc
> @@ -89,6 +89,12 @@ template<typename Int, bool ValidForPacks, bool
> ValidForArrays>
> }
> };
>
> +#if !_GLIBCXX_USE_CXX11_ABI
Would __cpp_lib_constexpr_exceptions be more precise, and make it
clearer exactly why we need to return early?
> + if consteval {
> + return true;
> + }
> +#endif
> +
> verify_throw(-1, 0, 0);
> verify_throw(0, -3, 0);
> verify_throw(0, 0, -5);
> --
> 2.53.0
>