C++: Parser regression over 1.1.2

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Tue Jun 8 00:03:00 GMT 1999


In egcs 1.1, we would accept the code

typedef unsigned int QRgb;
struct QColor{
  QColor( QRgb rgb);
};

struct QColorGroup{
  QColorGroup( const QColor &foreground, const QColor &background);
};

int main()
{
  QColorGroup normal( QColor( QRgb(16711680) ), QColor( QRgb(16777215) ));
}

On i486-pc-linux-gnu,  gcc-2.95 19990606 says

a.cc: In function `int main()':
a.cc:12: redeclaration of `struct QColor QRgb'
a.cc:12: `struct QColor QRgb' previously declared here

It somehow thinks this is a declaration. I don't think so :-)

Regards,
Martin


More information about the Gcc-bugs mailing list