Declaration conditions that declare an array outside of the declarator are incorrectly rejected
Open
clang:frontend
diverges-from:gcc
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The following program demonstrates the issue:
```cpp
int main(){
typedef int T[];
if(T b={0});
}
```
Clang appears to interpret this as violating:
> The declarator shall not specify a function or an array.
Section 8.1 [stmt.pre] Paragraph 4 N5032
This program does not use the declarator to specify an array, instead it is specified in the decl-specifier-seq so it should be accepted as it is with GCC. See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124199
Contributor guide
Assessment
This issue has not been assessed yet.