This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-10-26


2027. Unclear requirements for multiple alignas specifiers

Section: 9.12.2  [dcl.align]     Status: CD4     Submitter: Steve Clamage     Date: 2014-10-20

[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):

  1. Change 9.12.2 [dcl.align] paragraph 2 as follows:

  2. When the alignment-specifier is of the form alignas( constant-expression ):

  3. Change 9.12.2 [dcl.align] paragraph 4 as follows:

  4. When multiple alignment-specifiers are specified for an entity, the The alignment requirement shall be set to of an entity is the strictest specified non-zero alignment specified by its alignment-specifiers, if any; otherwise, the alignment-specifiers have no effect.