aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C
blob: ef29cffbd0b92d10bcce60c2faf60f51322e8bad (plain)
1
2
3
4
5
6
7
8
9
10
// Test that very different operators still cause ambiguity with reversed.

struct X { operator int(); };
bool operator==(X, int);    // #1 { dg-message "reversed" "" { target c++2a } }
struct Y { operator int(); };
bool operator==(Y, int);    // #2 { dg-message "reversed" "" { target c++2a } }

X x; Y y;
bool b1 = x == y;		// { dg-error "ambiguous" "" { target c++2a } }
bool b2 = y == x;		// { dg-error "ambiguous" "" { target c++2a } }