Doc. no.: n2028
Date: 2016-03-17
Reply to: Clark Nelson
Email: clark.nelson@intel.com

Resolving DR444

Primary change

6.7.2.1p1: Add a new alternative to specifier-qualifier-list:

specifier-qualifier-list:
type-specifier specifier-qualifier-listopt
type-qualifier specifier-qualifier-listopt
alignment-specifier specifier-qualifier-listopt

Consequences

specifier-qualifier-list is used in the grammar in only two productions: struct-declaration (which relates to the primary purpose of this DR), and type-name, which is used only in the definitions of these constructs:

WG14's desire seems to be to allow an alignment specification in a type name only for a compound literal.

Secondary change

6.7.5p2 currently reads:

An alignment attribute shall not be specified in a declaration of a typedef, or a bit-field, or a function, or a parameter, or an object declared with the register storage-class specifier.

This should be changed to:

An alignment specifier shall appear only in the declaration specifiers of a declaration, or in the specifier-qualifier list of a member declaration, or in the type name of a compound literal. An alignment specifier shall not be used in conjunction with either of the storage-class specifiers typedef or register , nor in a declaration of a function or bit-field.

Note: declaration-specifiers is also used in the grammar for parameter-declaration. So parameters are not included in “declaration specifiers of a declaration”, so they need not be disallowed explicitly.

Editorial issues noted during drafting

In 6.7.3p5, there are two references to specifier-qualifier-list, which should also reference declaration specifiers (and which, for consistency with the rest of the prose, should not use an italicized nonterminal name).

In 6.7.5, paragraph 4, there is another occurrence of the phrase “alignment attribute” which should instead read “alignment specifier”.