There are actually no conflicts to add an empty production alongside
the rule for "struct", "union" and "enum", which allows the subsequent
reductions for "tag identifier" and "[nothing] identifier" to be done
with just one rule.
This replaces a relatively large action from the eliminated rule with
a very simple one.
| T_COMPLEX
| T_IMAGINARY
-typespec_tagged: T_STRUCT | T_UNION | T_ENUM
+typespec_tagged: T_STRUCT | T_UNION | T_ENUM | { $$ = CDECL_TYPE_IDENT; }
qualifier_simple: T_CONST
| T_RESTRICT
ALLOC_STRUCT($$, struct cdecl_declspec,
.type = $1,
.ident = $2);
-} | T_IDENT {
- ALLOC_STRUCT($$, struct cdecl_declspec,
- .type = CDECL_TYPE_IDENT,
- .ident = $1);
}
declspec_noid: declspec_notype | typespec_noid