This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
[Voted into WP at March, 2010 meeting.]
According to 9.12.2 [dcl.align] paragraph 1, an alignment attribute can be specified only for a variable or a class data member. The corresponding Microsoft and GNU attributes can be also specified for a class type, and this usage seems to be widespread. It should be permitted with the standard attribute and there seems no good reason not to do so for enumeration types, as well.
Notes from the October, 2009 meeting:
Although there was initial concern for how to integrate the suggested change into the type system, it was observed that current practice is to have the attribute affect only the layout, not the type.
Proposed resolution (February, 2010):
Change 9.12.2 [dcl.align] paragraphs 1-2 as follows:
...The attribute can be applied to a variable that is neither a function parameter nor declared with the register storage class specifier and to a class data member that is not a bit-field.
When the alignment attribute is of the form align(assignment-expression):
if the constant expression evaluates to a fundamental alignment, the alignment requirement of the declared
objectshall 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
objectshall be that alignment
Change 9.12.2 [dcl.align] paragraphs 4-6 as follows:
When multiple alignment attributes are specified for an
object, the alignment requirement shall be set to the strictest specified alignment.
The combined effect of all alignment attributes in a declaration shall not specify an alignment that is less strict than the alignment that would otherwise be required for the
If the defining declaration of an
objecthas an alignment attribute, any non-defining declaration of that objectshall either specify equivalent alignment or have no alignment attribute. No diagnostic is required if declarations of an objecthave different alignment attributes in different translation units.
Insert the following as a new paragraph after 9.12.2 [dcl.align] paragraph 6:
Delete 9.12.2 [dcl.align] paragraph 8:
[Note: the alignment of a union type can be strengthened by applying the alignment attribute to any non-static data member of the union. —end note]