Prevent the following code from compiling: enum color {RED, GREEN, BLUE}; enum color {R, G, B}; int main() { return R; }
Unified · Split
| @@ -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; |