From: Russ Cox Date: Wed, 30 Sep 2009 17:25:22 +0000 (-0700) Subject: c compiler bug tickled by X-Git-Tag: weekly.2009-11-06~445 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5124e66fcae8a7758460266a4e88944abbe9e686;p=gostls13.git c compiler bug tickled by void f(struct { int x[1]; } p) { } the "int" was getting attached to f. R=ken OCL=35145 CL=35151 --- diff --git a/src/cmd/cc/cc.y b/src/cmd/cc/cc.y index 50d2ecdd87..0ade1d162c 100644 --- a/src/cmd/cc/cc.y +++ b/src/cmd/cc/cc.y @@ -44,6 +44,8 @@ { Type* t1; Type* t2; + Type* t3; + uchar c; } tyty; struct { @@ -925,16 +927,22 @@ sbody: { $$.t1 = strf; $$.t2 = strl; + $$.t3 = lasttype; + $$.c = lastclass; strf = T; strl = T; lastbit = 0; firstbit = 1; + lastclass = CXXX; + lasttype = T; } edecl '}' { $$ = strf; strf = $2.t1; strl = $2.t2; + lasttype = $2.t3; + lastclass = $2.c; } zctlist: