History

Forbid enum redefinition.

Prevent the following code from compiling: enum color {RED, GREEN, BLUE}; enum color {R, G, B}; int main() { return R; }

Thomas Preud'homme committed 13 years ago

Commit 0f522fb1 parent a465b7f1 file · +1 −0Browse files

Unified · Split

tccgen.c+1−0
@@ -2801,6 +2801,7 @@ static void struct_decl(CType *type, int u) · 2800 unmodified lines
28012801 if (tok == '}')
28022802 break;
28032803 }
2804+ s->c = type_size(&int_type, &align);
28042805 skip('}');
28052806 } else {
28062807 maxalign = 1;