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

#include <compare>

template<typename T>
struct X { };

template<typename T>
bool operator==(const X<T>&, const X<T>&) { return true; }
template<typename T>
bool operator<(const X<T>&, const X<T>&) { return true; }

struct Y
{
  int a;
  X<int> c;			// { dg-error "no match" }

  auto operator <=>(Y const&) const = default;
};

void f()
{
  auto x = Y() < Y();		// { dg-error "deleted" }
}