Title
Pointer-interconvertibility in non-standard-layout unions
Status
cd5
Section
6.8.4 [basic.compound]
Submitter
Richard Smith

Created on 2016-07-06.00:00:00 last changed 40 months ago

Messages

Date: 2017-07-15.00:00:00

[Voted into the WP at the July, 2017 meeting.]

Date: 2017-04-15.00:00:00

Proposed resolution (April, 2017):

Change 6.8.4 [basic.compound] bullet 4.2 as follows:

Two objects a and b are pointer-interconvertible if:

  • they are the same object, or

  • one is a standard-layout union object and the other is a non-static data member of that object (11.5 [class.union]), or

  • ...

Date: 2016-07-06.00:00:00

According to 11.5 [class.union] paragraph 2,

[Note: A union object and its non-static data members are pointer-interconvertible (6.8.4 [basic.compound], 7.6.1.9 [expr.static.cast]). As a consequence, all non-static data members of a union object have the same address. —end note]

However, the normative wording now only requires this for standard-layout unions.

History
Date User Action Args
2020-12-15 00:00:00adminsetstatus: drwp -> cd5
2018-02-27 00:00:00adminsetmessages: + msg6130
2018-02-27 00:00:00adminsetmessages: + msg6129
2016-07-06 00:00:00admincreate