gcc/testsuite/g++.dg/cpp2a/spaceship-synth-neg5.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | // { dg-options "" } |
| 3 | |
| 4 | #include <compare> |
| 5 | |
| 6 | struct C { |
| 7 | int y; |
| 8 | int x[]; // { dg-message "cannot default compare flexible array member" } |
| 9 | auto operator<=>(C const&) const = default; // { dg-message "is implicitly deleted because the default definition would be ill-formed" } |
| 10 | }; |
| 11 | |
| 12 | bool |
| 13 | foo (C &c1, C &c2) |
| 14 | { |
| 15 | return c1 > c2; // { dg-error "use of deleted function" } |
| 16 | } |