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
2801 if (tok == '}')2801 if (tok == '}')
2802 break;2802 break;
2803 }2803 }
2804 s->c = type_size(&int_type, &align);
2804 skip('}');2805 skip('}');
2805 } else {2806 } else {
2806 maxalign = 1;2807 maxalign = 1;