Call of overloaded function is ambiguous ?

Sebastian Ude ude@handshake.de
Fri Mar 15 15:29:00 GMT 2002



On 15 Mar 2002, aoliva@redhat.com (Alexandre Oliva) wrote:
> Date: 15 Mar 2002 19:49:53 -0300
> To: ude@handshake.de
> From: aoliva@redhat.com (Alexandre Oliva)
> CC: gcc@gcc.gnu.org
> Subject: Re: Call of overloaded function is ambiguous ?

[...]

> > That's clear to me - but why the different treatment of signed and
> > unsigned
> > integers ?
>
> Because the type of `0' is `int', so it's a perfect match for f(int).
> If there's only f(unsigned) and f(void*), both would need
> conversions sequences, none of which would be better than the other,
> so the call is ambiguous.

Ah - I see.

Thanks !


- Sebastian



More information about the Gcc mailing list