https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101138
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- ICC also accepts it but Microsoft rejects it. But ICC rejects the following which GCC still accepts: //#include <iostream> //using namespace std; #define printf __builtin_printf //template<typename T> struct D { template<typename Y> bool operator==(Y a) const { //cout << "f" <<endl; printf("f1\n"); return false; } }; template<typename T> bool operator==(T a, D b) { printf("f2\n"); return false; } struct ok; int main() { D a, b; if (a == b) return 0; return 1; }