Created on 2008-09-17.00:00:00 last changed 178 months ago
[Voted into WP at July, 2009 meeting.]
Proposed resolution (March, 2009):
Change the footnote in 6.8.5 [basic.type.qualifier] paragraph 1 as follows:
The same representation and alignment requirements are meant to imply interchangeability as arguments to functions, return values from functions, and non-static data members of unions.
Change 7.2.1 [basic.lval] bullet 15.6 as follows:
Change 7.6.9 [expr.rel] bullet 2.5 as follows:
Change 9.12.2 [dcl.align] paragraph 8 as follows:
[Note: the alignment of a union type can be strengthened by applying the alignment attribute to any non-static data member of the union. —end note]
Change 9.4.2 [dcl.init.aggr] paragraph 15 as follows:
When a union is initialized with a brace-enclosed initializer, the braces shall only contain an initializer-clause for the first non-static data member of the union...
Change 11.5 [class.union] paragraph 1 as follows:
In a union, at most one of the non-static data members can be active at any time, that is, the value of at most one of the non-static data members can be stored in a union at any time. [Note: one special guarantee is made in order to simplify the use of unions: If a standard-layout union contains several standard-layout structs that share a common initial sequence (11.4 [class.mem]), and if an object of this standard-layout union type contains one of the standard-layout structs, it is permitted to inspect the common initial sequence of any of standard-layout struct members; see 11.4 [class.mem]. —end note] The size of a union is sufficient to contain the largest of its non-static data members. Each non-static data member is allocated as if it were the sole member of a struct. A union can have...
Unions are no longer forbidden to have static data members; however, much of the wording of 11.5 [class.union] (and possibly other places in the Standard) is still written with that assumption and refers only to “data members” when clearly non-static data members are in view. From paragraph 1, for example:
In a union, at most one of the data members can be active at any time... The size of a union is sufficient to contain the largest of its data members...
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | status: wp -> cd2 |
2009-11-08 00:00:00 | admin | set | status: dr -> wp |
2009-08-03 00:00:00 | admin | set | messages: + msg2262 |
2009-08-03 00:00:00 | admin | set | status: ready -> dr |
2009-03-23 00:00:00 | admin | set | messages: + msg1892 |
2009-03-23 00:00:00 | admin | set | status: open -> ready |
2008-09-17 00:00:00 | admin | create |