summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-eq14.C
blob: 896e5232bf69de589fba81da1affec02e913e333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/106361
// { dg-do compile { target c++20 } }

struct foo {
  int x;
};

struct bar {
  foo f;			// { dg-error "operator==" }
  friend bool operator==(const bar& a, const bar& b);
};

bool operator==(const bar& a, const bar& b) = default;

int main() {
  return bar{} == bar{};	// { dg-error "deleted" }
}