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
<algorithm> for ranges::fold_left.
libstdc++-v3/ChangeLog:
PR libstdc++/119144
* testsuite/26_numerics/complex/tuple_like.cc: Include
<algorithm>, replace std::string with std::string_view,
instantiate tests for long instead of size_t.
---
Tested x86_64-linux (with -m32 and -D_GLIBCXX_USE_CXX11_ABI=0 and
--disable-libstdcxx-pch).
Pushed to trunk.
libstdc++-v3/testsuite/26_numerics/complex/tuple_like.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
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 <complex>
#include <ranges>
-#include <string>
+#include <algorithm>
+#include <string_view>
#include <type_traits>
#include <tuple>
#include <utility>
@@ -83,10 +84,10 @@ void
test_tuple_cat()
{
std::complex<T> cpx(T(1), T(2));
- std::pair<int, std::string> p(42, "hello");
+ std::pair<int, std::string_view> p(42, "hello");
auto r = std::tuple_cat(cpx, p, cpx);
- static_assert(std::is_same_v<decltype(r), std::tuple<T, T, int, std::string,
T, T>>);
+ static_assert(std::is_same_v<decltype(r), std::tuple<T, T, int,
std::string_view, T, T>>);
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)
--
2.48.1