comparison gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite3.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
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++2a } }
5 struct Y { operator int(); };
6 bool operator==(Y, int); // #2 { dg-message "reversed" "" { target c++2a } }
7
8 X x; Y y;
9 bool b1 = x == y; // { dg-error "ambiguous" "" { target c++2a } }
10 bool b2 = y == x; // { dg-error "ambiguous" "" { target c++2a } }