Created on2013-02-01.00:00:00 last changed109 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (February, 2014):
Change 9.13.2 [dcl.align] paragraph 5 as follows:
...if allalignment-specifiersappertaining to thatentity were omitted
(including those in otherdeclarations).[Example:struct alignas(8) S {}; struct alignas(1) U { S s; }; // Error:U specifies an alignment that is less strict than // if thealignas(1) were omitted.—end example]
According to 9.13.2 [dcl.align] paragraph 5,
The combined effect of allalignment-specifiers in a declarationshall not specify an alignment that is less strict than the alignment thatwould be required for the entity being declared ifallalignment-specifiers were omitted (including those in otherdeclarations).
Presumably the intent was “other declarations of the sameentity,” but the wording as written could be read to make thefollowing example well-formed (assumingalignof(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 | |