EDG based compilers (Intel, Comeau) fail on the following code
struct A;
//typedef int A;
struct B {
operator const A & ();
};
void g(const A &);
void g(A &);
int main() {
g(B());
}
with the error
error: more than one instance of overloaded function "g" matches the argument list, the choices that match are: function "g(const A &)" function "g(A &)" The argument types that you used are: (B) g(B());
but do not fail when the typedef is used in place of the struct.
I have reported this to EDG and Comeau, with no replies. I would report it to Intel, but they have made doing so quite difficult by designing their website poorly.
Update: EDG replied, saying it was a bug. [an error occurred while processing this directive]