aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index 77ff87c..0f0aac5 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -2786,6 +2786,10 @@ static void struct_decl(CType *type, int u, int tdef)
v = tok;
if (v < TOK_UIDENT)
expect("identifier");
+ ss = sym_find(v);
+ if (ss)
+ tcc_error("redefinition of enumerator '%s'",
+ get_tok_str(v, NULL));
next();
if (tok == '=') {
next();