]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix test that fails for C++20
authorJonathan Wakely <jwakely@redhat.com>
Tue, 12 Oct 2021 14:39:18 +0000 (15:39 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 12 Oct 2021 15:54:57 +0000 (16:54 +0100)
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)

libstdc++-v3/testsuite/20_util/tuple/comparison_operators/overloaded.cc

index a25c374a9325d79478aad9a33b12f47bb10b6292..a9bc2c7dfb52fb7be5dfed41b4570bbb6935b408 100644 (file)
@@ -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