Allow local redefinition of enumerator

This commit is contained in:
Thomas Preud'homme
2014-03-31 22:58:17 +08:00
parent a620b12dc1
commit 3e56584223
4 changed files with 17 additions and 2 deletions

View File

@ -2827,7 +2827,7 @@ static void struct_decl(CType *type, int u, int tdef)
if (v < TOK_UIDENT)
expect("identifier");
ss = sym_find(v);
if (ss)
if (ss && !local_stack)
tcc_error("redefinition of enumerator '%s'",
get_tok_str(v, NULL));
next();