Call of overloaded function is ambiguous ?

Joe Buck Joe.Buck@synopsys.com
Fri Mar 15 12:23:00 GMT 2002


> g++ from GCC 2.95.3 produces an error message with the following code:

void f ( unsigned int ) { }
void f ( void * ) { }
 
int main ( void ) {
   f ( 0 ) ;
   return 0 ;
}

Yes.  The code contains an error; all C++ compilers that conform to
the standard will give the same error.  The scoring system used in
the language rules considers both candidates to be equally good matches.

> Now, I am confused ...

You need a good C++ book.



More information about the Gcc mailing list