This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: G++ bug


On Sep 20, 1999, Andy Rysin <arysin@yahoo.com> wrote:

> Problem: GCC can not distinct 'typedef unsigned int
> Rgb' from 'char *' in overloaded constructor when
> argument is 'Rgb(0)'.

Try `0u'.  The type of `0' is `int', not `unsigned int'.  Converting
`int' to `unsigned int' is an integral conversion, and `int' to
`char*' is a pointer conversion.  Since both are conversions, neither
is better; overload resolution fails due to ambiguity.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]