Date
2012-02-02.00:00:00
Message id
4279

Content

According to 9.13.2 [dcl.align] paragraph 6,

If the defining declaration of an entity has an alignment-specifier, any non-defining declaration of that entity shall either specify equivalent alignment or have no alignment-specifier. Conversely, if any declaration of an entity has an alignment-specifier, every defining declaration of that entity shall specify an equivalent alignment. No diagnostic is required if declarations of an entity have different alignment-specifiers in different translation units.

Because this is phrased in terms of the definition of an entity, an example like the following is presumably well-formed (even though there can be no definition of n):

   alignas(8) extern int n;
   alignas(16) extern int n;

Is this intentional?