gcc/testsuite/g++.dg/cpp2a/spaceship-err3.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | |
| 3 | namespace std |
| 4 | { |
| 5 | int strong_ordering; |
| 6 | struct partial_ordering { |
| 7 | static int equivalent (); |
| 8 | }; |
| 9 | } |
| 10 | |
| 11 | auto a = 1 <=> 2; // { dg-error "'std::strong_ordering' is not a type" } |
| 12 | // { dg-message "forming type of 'operator<=>'" "" { target *-*-* } .-1 } |
| 13 | auto b = 3.0 <=> 4.0; // { dg-error "'std::partial_ordering::equivalent\\(\\)' is not a static data member" } |
| 14 | // { dg-message "determining value of 'operator<=>'" "" { target *-*-* } .-1 } |