view 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
line wrap: on
line source

// 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 } }