From: Jonathan Wakely Date: Thu, 6 Mar 2025 16:04:05 +0000 (+0000) Subject: libstdc++: Fix failures in new std::complex test [PR119144] X-Git-Tag: basepoints/gcc-16~1690 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2b022e38a778d64350f4d4236a2c8a36e0e621c;p=thirdparty%2Fgcc.git libstdc++: Fix failures in new std::complex test [PR119144] This test fails due to duplicate explicit instantiations on targets where size_t and unsigned int are the same type. It also fails with -D_GLIBCXX_USE_CXX11_ABI=0 due to using std::string in constexpr functions, and with --disable-libstdcxx-pch due to not including for ranges::fold_left. libstdc++-v3/ChangeLog: PR libstdc++/119144 * testsuite/26_numerics/complex/tuple_like.cc: Include , replace std::string with std::string_view, instantiate tests for long instead of size_t. --- diff --git a/libstdc++-v3/testsuite/26_numerics/complex/tuple_like.cc b/libstdc++-v3/testsuite/26_numerics/complex/tuple_like.cc index 7d8d2ee99ce..1150861ae0a 100644 --- a/libstdc++-v3/testsuite/26_numerics/complex/tuple_like.cc +++ b/libstdc++-v3/testsuite/26_numerics/complex/tuple_like.cc @@ -2,7 +2,8 @@ #include #include -#include +#include +#include #include #include #include @@ -83,10 +84,10 @@ void test_tuple_cat() { std::complex cpx(T(1), T(2)); - std::pair p(42, "hello"); + std::pair p(42, "hello"); auto r = std::tuple_cat(cpx, p, cpx); - static_assert(std::is_same_v>); + static_assert(std::is_same_v>); VERIFY(std::get<0>(r) == T(1)); VERIFY(std::get<1>(r) == T(2)); VERIFY(std::get<2>(r) == 42); @@ -176,4 +177,4 @@ TEST(__gnu_cxx::__bfloat16_t) TEST(char) TEST(int) TEST(unsigned int) -TEST(size_t) +TEST(long)