Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/spaceship-synth17.C

raw
1 // PR c++/118387
2 // { dg-do compile { target c++20 } }
3
4 #include <compare>
5
6 struct B {};
7
8 struct A
9 {
10 B b; // { dg-error "no match for 'operator<=>' in '\[^\n\r]*' \\\(operand types are 'B' and 'B'\\\)" }
11 int operator<=> (const A &) const = default; // { dg-error "invalid 'static_cast' from type 'const std::strong_ordering' to type 'int'" }
12 };
13
14 int
15 main ()
16 {
17 A a;
18 return a <=> a; // { dg-error "use of deleted function 'constexpr int A::operator<=>\\\(const A&\\\) const'" }
19 }