diff --git a/Parser.pas b/Parser.pas index 2358449..89985bd 100644 --- a/Parser.pas +++ b/Parser.pas @@ -3181,9 +3181,10 @@ while token.kind in allowedTokens do begin Error(143); NextToken; {skip the 'enum' token} if token.kind in [ident,typedef] then begin {handle a type definition} - variable := FindSymbol(token, tagSpace, true, true); ttoken := token; NextToken; + variable := + FindSymbol(ttoken, tagSpace, token.kind = lbracech, true); if variable <> nil then if variable^.itype^.kind = enumType then if token.kind <> lbracech then diff --git a/cc.notes b/cc.notes index 24f861c..6eab4d2 100644 --- a/cc.notes +++ b/cc.notes @@ -1895,6 +1895,8 @@ int foo(int[42]); 205. Using the same identifier as a typedef name and then as the tag for an enum would cause a spurious error. +206. If an enum type defined in an outer scope was used in an inner scope, and then a new struct, union, or enum type was declared with the same tag in the same inner scope, a spurious error was reported. + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.