libstdc++: Make constexpr-if actually disable some tests [PR124722]

Message ID 12523330.nUPlyArG6x@vir-laptop
State New
Headers
Series libstdc++: Make constexpr-if actually disable some tests [PR124722] |

Commit Message

Matthias Kretz April 7, 2026, 10:19 a.m. UTC
  libstdc++-v3/ChangeLog:

	PR libstdc++/124722
	* testsuite/std/simd/traits_impl.cc (test): Make test() a
	function template and instantiate it.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
---
 libstdc++-v3/testsuite/std/simd/traits_impl.cc | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Jonathan Wakely April 7, 2026, 3:45 p.m. UTC | #1
On Tue, 7 Apr 2026, 11:19 Matthias Kretz, <MatthiasKretz@gmx.net> wrote:

> libstdc++-v3/ChangeLog:
>
>         PR libstdc++/124722
>         * testsuite/std/simd/traits_impl.cc (test): Make test() a
>         function template and instantiate it.
>
> Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
>


OK

---
>  libstdc++-v3/testsuite/std/simd/traits_impl.cc | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/std/simd/traits_impl.cc b/libstdc++-v3/
> testsuite/std/simd/traits_impl.cc
> index 06bf6d5be25..f73a9e3beb5 100644
> --- a/libstdc++-v3/testsuite/std/simd/traits_impl.cc
> +++ b/libstdc++-v3/testsuite/std/simd/traits_impl.cc
> @@ -17,6 +17,7 @@ namespace simd
>
>  using namespace std::simd;
>
> +template <int = 0>
>  void test()
>  {
>    template for (auto t : {float(), double(),
> @@ -147,6 +148,8 @@ namespace simd
>    static_assert(__highest_bit(0b10000001000ull) == 10);
>  }
>
> +template void test<>();
> +
>  consteval bool
>  throws(auto f)
>  {
> --
> ──────────────────────────────────────────────────────────────────────────
>  Dr. Matthias Kretz                           https://mattkretz.github.io
>  GSI Helmholtz Center for Heavy Ion Research               https://gsi.de
>  std::simd
> ──────────────────────────────────────────────────────────────────────────
>
>
  

Patch

diff --git a/libstdc++-v3/testsuite/std/simd/traits_impl.cc b/libstdc++-v3/
testsuite/std/simd/traits_impl.cc
index 06bf6d5be25..f73a9e3beb5 100644
--- a/libstdc++-v3/testsuite/std/simd/traits_impl.cc
+++ b/libstdc++-v3/testsuite/std/simd/traits_impl.cc
@@ -17,6 +17,7 @@  namespace simd
 
 using namespace std::simd;
 
+template <int = 0>
 void test()
 {
   template for (auto t : {float(), double(),
@@ -147,6 +148,8 @@  namespace simd
   static_assert(__highest_bit(0b10000001000ull) == 10);
 }
 
+template void test<>();
+
 consteval bool
 throws(auto f)
 {