From: Jonathan Wakely Date: Tue, 12 Oct 2021 14:39:18 +0000 (+0100) Subject: libstdc++: Fix test that fails for C++20 X-Git-Tag: releases/gcc-11.3.0~771 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8104d4fff6202dabcb2eef7406f64d26f97f341d;p=thirdparty%2Fgcc.git libstdc++: Fix test that fails for C++20 Restore the test for 'a < a' that was removed by r12-2537 because it is ill-formed. We still want to test operator< for tuple, we just need to not use std::nullptr_t in that tuple type. libstdc++-v3/ChangeLog: * testsuite/20_util/tuple/comparison_operators/overloaded.cc: Restore test for operator<. (cherry picked from commit 727137d6ca6d3d401a0c1b4df6b9aae8b97dacd5) --- diff --git a/libstdc++-v3/testsuite/20_util/tuple/comparison_operators/overloaded.cc b/libstdc++-v3/testsuite/20_util/tuple/comparison_operators/overloaded.cc index a25c374a9325..a9bc2c7dfb52 100644 --- a/libstdc++-v3/testsuite/20_util/tuple/comparison_operators/overloaded.cc +++ b/libstdc++-v3/testsuite/20_util/tuple/comparison_operators/overloaded.cc @@ -48,4 +48,9 @@ TwistedLogic operator<(const Compares&, const Compares&) { return {false}; } auto a = std::make_tuple(nullptr, Compares{}, 2, 'U'); auto b = a == a; -auto c = a < a; + +#if ! __cpp_lib_three_way_comparison +// Not valid in C++20, because TwistedLogic doesn't model boolean-testable. +auto c = std::make_tuple("", Compares{}, 2, 'U'); +auto d = c < c; +#endif