https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113387
Bug ID: 113387
Summary: __attribute__ does not mix with [[gnu:]]
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: gjl at gcc dot gnu.org
Target Milestone: ---
The following compiles fine
[[gnu::used]] __attribute__((used)) int x;
while
__attribute__((used)) [[gnu::used]] int x;
bar.c:1:1: warning: 'used' attribute does not apply to types [-Wattributes]
1 | __attribute__((used)) [[gnu::used]] int x;
| ^~~~~~~~~~~~~
bar.c:1:37: error: expected identifier or '(' before 'int'
1 | __attribute__((used)) [[gnu::used]] int x;
| ^~~
IMO both should be valid.