aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-sfinae3.C
blob: ca159260ec79e28ae3073ef276cc369ea117ad13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/113529
// { dg-do compile { target c++20 } }

#include <compare>

struct A {
  auto operator<=>(const A&) const = default;
  bool operator<(const A&) const;
};
struct B {
  auto operator<=>(const B&) const = default;
};
struct C : A, B { };


template<class T>
void f(T u, T v) {
  static_assert(!requires { u < v; });
  u < v; // { dg-error "request for member 'operator<=>' is ambiguous" }
}

template void f(C, C);