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

#include <compare>

struct B {};

struct A
{
  B b;			// { dg-error "no match for 'operator<=>' in '\[^\n\r]*' \\\(operand types are 'B' and 'B'\\\)" }
  int operator<=> (const A &) const = default;	// { dg-error "invalid 'static_cast' from type 'const std::strong_ordering' to type 'int'" }
};

int
main ()
{
  A a;
  return a <=> a;	// { dg-error "use of deleted function 'constexpr int A::operator<=>\\\(const A&\\\) const'" }
}