Open ebdd6ebc-1612-4e9b-aee1-f7d2b6361d5f opened 5 years ago
Consider the following C11 program (prog.c):
void f(e) enum { x } e; { x; }
int main() { }
I was compiling this program with:
clang prog.c -std=c11 -pedantic-errors "-w"
The expected behaviour is that it should work, but I get the following error:
error: use of undeclared identifier 'x'
Note that it works fine when using the new style of declaring function parameters.
Also note that it works fine in gcc.
Link to online compiler:
https://wandbox.org/permlink/CGczhD2xFRJkUzTs
@llvm/issue-subscribers-c
@llvm/issue-subscribers-clang-frontend
Issue reproduces as of Clang 16.0.0: https://gcc.godbolt.org/z/f6jEGeaaz
Extended Description
Consider the following C11 program (prog.c):
void f(e) enum { x } e; { x; }
int main() { }
I was compiling this program with:
clang prog.c -std=c11 -pedantic-errors "-w"
The expected behaviour is that it should work, but I get the following error:
error: use of undeclared identifier 'x'
Note that it works fine when using the new style of declaring function parameters.
Also note that it works fine in gcc.
Link to online compiler:
https://wandbox.org/permlink/CGczhD2xFRJkUzTs