This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-12-19
[Moved to DR at the October, 2015 meeting.]
The description of alignment-specifiers is unclear. For example, 9.12.2 [dcl.align] bullet 2.2 says,
if the constant expression evaluates to a fundamental alignment, the alignment requirement of the declared entity shall be the specified fundamental alignment
However, paragraph 4 says,
When multiple alignment-specifiers are specified for an entity, the alignment requirement shall be set to the strictest specified alignment.
meaning that a less-strict alignment will be ignored, rather than being the alignment of the entity, and presumably meaning that no diagnostic is required for an insufficiently-strict alignment if a more stringent requirement is also supplied.
Proposed resolution (May, 2015):
Change 9.12.2 [dcl.align] paragraph 2 as follows:
When the alignment-specifier is of the form alignas( constant-expression ):
the constant-expression shall be an integral constant expression;
if the constant expression evaluates to a fundamental alignment, the alignment requirement of the declared entity shall be the specified fundamental alignment
if the constant expression evaluates to an extended alignment and the implementation supports that alignment in the context of the declaration, the alignment of the declared entity shall be that alignmentif the constant expression does not evaluate to an alignment value (6.7.3 [basic.align]), or evaluates to an extended alignment and the implementation does not support that alignment in the context of the declaration, the program is ill-formed.
if the constant expression evaluates to zero, the alignment specifier shall have no effect
otherwise, the program is ill-formed.
Change 9.12.2 [dcl.align] paragraph 4 as follows:
When multiple alignment-specifiers are specified for an entity, theThe alignment requirementshall be set toof an entity is the strictestspecifiednon-zero alignment specified by its alignment-specifiers, if any; otherwise, the alignment-specifiers have no effect.