https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124317
Bug ID: 124317
Summary: Rejects attribute after declarator in type-id
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: suyuchang at whu dot edu.cn
Target Milestone: ---
The code places an attribute-specifier-seq after a pointer declarator within a
type-id: struct { } * [[ ]] volatile. Clang accepts it, while GCC rejects it.
Code:
using X0 = struct { } * [ [ ] ] volatile ;
Command:
g++ -c test.cpp
<source>:1:32: error: expected ';' before 'volatile'
1 | using X0 = struct { } * [ [ ] ] volatile ;
| ^~~~~~~~~
| ;
See Compiler Explorer: https://godbolt.org/z/Go3957n1T
The test case was generated by a fuzzer.