Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/spaceship-sfinae3.C

raw
1 // PR c++/113529
2 // { dg-do compile { target c++20 } }
3
4 #include <compare>
5
6 struct A {
7 auto operator<=>(const A&) const = default;
8 bool operator<(const A&) const;
9 };
10 struct B {
11 auto operator<=>(const B&) const = default;
12 };
13 struct C : A, B { };
14
15
16 template<class T>
17 void f(T u, T v) {
18 static_assert(!requires { u < v; });
19 u < v; // { dg-error "request for member 'operator<=>' is ambiguous" }
20 }
21
22 template void f(C, C);