Candidate fix for PR c/7353

Zack Weinberg zack@codesourcery.com
Fri Nov 1 09:45:00 GMT 2002


On Fri, Nov 01, 2002 at 01:55:48AM -0500, Jason Merrill wrote:
> This patch causes us to no longer give an error for
> 
>   struct A {
>     typedef int B = 0;
>   };

Huh?

$ ./cc1 -quiet test.c
test.c:2: error: parse error before "typedef"
test.c:2: warning: no semicolon at end of struct or union

$ ./cc1plus -quiet test.c
test.c:2: error: ISO C++ forbids declaration of `B' with no type

Not the *best* diagnostics, but I don't feel it's worth trying to get
good diagnostics out of the old parser.

zw



More information about the Gcc-patches mailing list