Movatterモバイル変換


[0]ホーム

URL:


Issue 1615 - WG21 CWG Issues
Title
Alignment of types, variables, and members
Status
cd4
Section
9.13.2 [dcl.align]
Submitter
Richard Smith

Created on2013-02-01.00:00:00 last changed109 months ago

Messages

msg5373 (view)
Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

msg4319 (view)
Date: 2014-02-15.00:00:00

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]

msg4278 (view)
Date: 2013-05-03.00:00:00

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
DateUserActionArgs
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: +msg5373
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetstatus: review -> ready
2013-05-03 00:00:00adminsetmessages: +msg4319
2013-05-03 00:00:00adminsetstatus: open -> review
2013-02-01 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp