[*]
in abstract declaratorsAuthors: Joseph Myers
Date: 2025-03-06
Submitted against: C23
Status: Open
Cross-references: 0289
An array declarator can have the form (syntax in C23 6.7.7.1):
direct-declarator
[
type-qualifier-listopt*
]
but the corresponding abstract-declarator syntax in 6.7.8 omits the
type-qualifier-listopt. David Keaton stated in
reflector message
14798 that this
difference was not deliberate. The response to issue
0289 fixed such a difference in the case where an
assignment expression is involved, but did nothing about the [*]
case.
If abstract declarators have a more restrictive syntax than
declarators, that confuses both the rules about replacing an
expression at function prototype scope with *
, and the rule that
"If, in a parameter declaration, an identifier can be treated either
as a typedef name or as a parameter name, it shall be taken as a
typedef name.". It seems clear that the syntax should match in the
two cases.
In C23 6.7.8 (Type names), change the fourth option in the Syntax for array-abstract-declarator:
direct-abstract-declaratoropt
[
type-qualifier-listopt*
]