Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C

raw
1 // Test that very different operators still cause ambiguity with reversed.
2
3 struct X { operator int(); };
4 bool operator==(X, int); // #1 { dg-message "reversed" "" { target c++20 } }
5 struct Y { operator int(); };
6 bool operator==(Y, int); // #2 { dg-message "reversed" "" { target c++20 } }
7
8 X x; Y y;
9 bool b1 = x == y; // { dg-error "ambiguous" "" { target c++20 } }
10 bool b2 = y == x; // { dg-error "ambiguous" "" { target c++20 } }