gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite1.C
raw| 1 | // This should continue to work. |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<class T> |
| 5 | struct A { |
| 6 | template<class U> |
| 7 | bool operator==(const A<U>&); |
| 8 | }; |
| 9 | |
| 10 | int main() |
| 11 | { |
| 12 | A<int> a1; |
| 13 | A<void> a2; |
| 14 | return a1 == a2; // { dg-error "ambiguous, even though the second is reversed" } |
| 15 | } |