https://bugs.llvm.org/show_bug.cgi?id=50954
Bug ID: 50954
Summary: C2x attributes on array declarators handled
incorrectly
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Consider the following:
```
void func(void) {
int a[10] [[maybe_unused]], b;
}
```
The declaration of `a` should not be accepted in C++ or C mode because the
attribute in that position appertains to the array type (6.7.6.2p3,
[dcl.array]p3).
In C++ mode, we reject this code as the attribute does not apply to types, but
we accept the code in C mode.
https://godbolt.org/z/9n3azao7f
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs