gcc/testsuite/g++.dg/cpp2a/spaceship-fallback1.C
raw| 1 | // PR c++/100367 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | #include <compare> |
| 5 | |
| 6 | struct iter { |
| 7 | bool current; |
| 8 | iter(iter &); |
| 9 | }; |
| 10 | |
| 11 | constexpr bool operator==(const iter &, const iter &y) { |
| 12 | return y.current; |
| 13 | } |
| 14 | |
| 15 | void lexicographical_compare_three_way(iter a) { |
| 16 | (a == a) <=> true; |
| 17 | } |