gcc/testsuite/g++.dg/cpp2a/spaceship-eq13.C
raw| 1 | // PR c++/98712 |
| 2 | // { dg-do run { target c++20 } } |
| 3 | |
| 4 | struct S |
| 5 | { |
| 6 | int s = 0; |
| 7 | S(int s) : s(s) {} |
| 8 | bool operator==(const S&) const = default; |
| 9 | }; |
| 10 | |
| 11 | struct T : S |
| 12 | { |
| 13 | T(int s) : S(s) {} |
| 14 | constexpr bool operator==(const T&) const = default; |
| 15 | }; |
| 16 | |
| 17 | int |
| 18 | main() |
| 19 | { |
| 20 | if (T(0) == T(1)) |
| 21 | __builtin_abort (); |
| 22 | } |