This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Call of overloaded function is ambiguous ?
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: ude at handshake dot de
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 15 Mar 2002 12:23:32 -0800 (PST)
- Subject: Re: Call of overloaded function is ambiguous ?
> 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.