like on 'enum myenum { L = -1 } L;'. It's a bit tedious as there are two paths (for global vs local symbols), and because the scope and enum_val share same storage.
Showing the changes to tests (2 of 3 files). Show all
Unified · Split
| @@ -124,4 +124,10 @@ void f() { _Generic((int const *[]){0}, int:0); } · 123 unmodified lines | ||
| 124 | 124 | void f() { _Generic((int (*(*)(float,char))(double,int)){0}, int:0); } |
| 125 | 125 | #elif defined test_array_to_str |
| 126 | 126 | void f() { _Generic((int(*)[3]){0}, int:0); } |
| 127 | +#elif defined test_duplicate_def_1 | |
| 128 | +static enum myenum { L = -1 } L; | |
| 129 | +#elif defined test_duplicate_def_2 | |
| 130 | +void foo(void) { | |
| 131 | +static enum myenum { L = -1 } L; | |
| 132 | +} | |
| 127 | 133 | #endif |
| @@ -53,3 +53,9 @@ · 52 unmodified lines | ||
| 53 | 53 | |
| 54 | 54 | [test_array_to_str] |
| 55 | 55 | 60_errors_and_warnings.c:126: error: type 'int (*)[3]' does not match any association |
| 56 | + | |
| 57 | +[test_duplicate_def_1] | |
| 58 | +60_errors_and_warnings.c:128: error: redefinition of 'L' | |
| 59 | + | |
| 60 | +[test_duplicate_def_2] | |
| 61 | +60_errors_and_warnings.c:131: error: redeclaration of 'L' | |