Created on 2013-02-01.00:00:00 last changed 94 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (February, 2014):
Change 9.12.2 [dcl.align] paragraph 5 as follows:
...if all alignment-specifiers appertaining to that entity were omitted
(including those in other declarations). [Example:struct alignas(8) S {}; struct alignas(1) U { S s; }; // Error: U specifies an alignment that is less strict than // if the alignas(1) were omitted.—end example]
According to 9.12.2 [dcl.align] paragraph 5,
The combined effect of all alignment-specifiers in a declaration shall not specify an alignment that is less strict than the alignment that would be required for the entity being declared if all alignment-specifiers were omitted (including those in other declarations).
Presumably the intent was “other declarations of the same entity,” but the wording as written could be read to make the following example well-formed (assuming alignof(int) is 4):
struct alignas(4) A { alignas(8) int n; }; struct alignas(8) B { char c; }; alignas(1) B b; struct alignas(1) C : B {}; enum alignas(8) E : int { k }; alignas(4) E e = k;
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5373 |
2014-11-24 00:00:00 | admin | set | status: ready -> dr |
2014-03-03 00:00:00 | admin | set | status: review -> ready |
2013-05-03 00:00:00 | admin | set | messages: + msg4319 |
2013-05-03 00:00:00 | admin | set | status: open -> review |
2013-02-01 00:00:00 | admin | create |