G++ bug

Alexandre Oliva oliva@lsd.ic.unicamp.br
Thu Sep 30 19:57:00 GMT 1999


On Sep 20, 1999, Ross Smith <ross.s@ihug.co.nz> wrote:

> No, I think Andy is right. He's explicitly casting the 0 to QRgb

I stand corrected.  I had missed the cast.

The code snippet you posted invokes a well-known bug in the g++
parser, that, in this case, leads to the overload resolution error.

The well-known bugs page recommends replacing:

  QColorGroup q(QColor(QRgb(0))); // doesn't work

with

  QColorGroup q(QColor((0,QRgb(0)))); // doesn't work
                       ^^^       ^

This will help gcc parse it as an expression, as it should, not as a
declaration, as it does.

-- 
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