Title
Comparing pointers to union members
Status
cd4
Section
7.6.10 [expr.eq]
Submitter
Richard Smith

Created on 2014-02-12.00:00:00 last changed 94 months ago

Messages

Date: 2014-11-15.00:00:00

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

Date: 2014-07-15.00:00:00

Proposed Resolution (July, 2014):

Insert the following before bullet 5 of 7.6.10 [expr.eq] paragraph 3:

  • ...

  • If both refer to (possibly different) members of the same union (11.5 [class.union]), they compare equal.

  • Otherwise, two pointers to members compare equal if...

Date: 2014-02-12.00:00:00

Comparison of pointers to members is currently specified in 7.6.10 [expr.eq] paragraph 3 as,

two pointers to members compare equal if they would refer to the same member of the same most derived object (6.7.2 [intro.object]) or the same subobject if indirection with a hypothetical object of the associated class type were performed, otherwise they compare unequal.

The “same member” requirement could be interpreted as incorrect for union members. The wording should be clarified in this regard.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5349
2014-11-24 00:00:00adminsetstatus: tentatively ready -> dr
2014-10-13 00:00:00adminsetmessages: + msg5133
2014-10-13 00:00:00adminsetstatus: drafting -> tentatively ready
2014-07-07 00:00:00adminsetstatus: open -> drafting
2014-02-12 00:00:00admincreate