gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C
raw| 1 | // PR c++/116289 |
| 2 | // PR c++/113063 |
| 3 | // { dg-do link { target c++20 } } |
| 4 | // A version of spaceship-synth16.C where the local class isn't empty. |
| 5 | |
| 6 | #include <compare> |
| 7 | |
| 8 | int main() { |
| 9 | struct X { |
| 10 | int m = 0; |
| 11 | auto operator<=>(const X&) const = default; |
| 12 | }; |
| 13 | X x; |
| 14 | static_assert(noexcept(x <=> x)); |
| 15 | x <=> x; |
| 16 | constexpr auto r = X{} <=> X{}; |
| 17 | } |