Created on 2016-01-12.00:00:00 last changed 83 months ago
Notes from the February, 2017 meeting:
CWG agreed that the intent of the wording is that the “strictest” requirement is intended to apply to a single declaration, and the requirement for compatibility should apply to all declarations, whether the entity is defined or not.
According to 9.12.2 [dcl.align] paragraph 4,
The alignment requirement of an entity is the strictest non-zero alignment specified by its alignment-specifiers, if any; otherwise, the alignment-specifiers have no effect.
It is not clear whether this applies to specifiers within a single declaration, or if it is intended to apply to the union of all declarations.
Similarly, paragraph 6 says,
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.
This only talks about agreement between definitions and non-defining declarations. What about an example where an entity is not defined but is declared with different alignment-specifiers?
struct alignas(16) A; struct alignas(32) A;
If A is not defined, is this, or should it be, ill-formed?
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-02-27 00:00:00 | admin | set | messages: + msg5904 |
2018-02-27 00:00:00 | admin | set | status: open -> drafting |
2016-01-12 00:00:00 | admin | create |