aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg4.C
blob: e99aa0a2041221c33c4a468eb8d245fa595ba841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// P2002: deleted if a subobject <=> has non-category type.
// { dg-do compile { target c++20 } }

#include <compare>

struct A
{
  bool operator<=>(const A&) const;
};

struct B
{
  A a;				// { dg-message "bool" }
  auto operator<=>(const B&) const = default;
};

int main()
{
  auto x = B() <=> B();		// { dg-error "deleted" }
}