G++ bug

Alexandre Oliva oliva@lsd.ic.unicamp.br
Mon Sep 20 17:29:00 GMT 1999


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



More information about the Gcc-bugs mailing list