Title
Overlapping empty subobjects with different cv-qualification
Status
drwp
Section
6.7.2 [intro.object]
Submitter
Jonathan Caves

Created on 2023-09-04.00:00:00 last changed 8 months ago

Messages

Date: 2023-09-15.21:51:11

Proposed resolution (approved by CWG 2023-09-15):

(Hypothetically, pointer-to-member types can be empty, but might differ in non-top-level cv-qualification.)

Change in 6.7.2 [intro.object] paragraph 9 as follows:

... Two objects with overlapping lifetimes that are not bit-fields may have the same address if one is nested within the other, or if at least one is a subobject of zero size and they are not of different similar types (7.3.6 [conv.qual]); otherwise, they have distinct addresses and occupy disjoint bytes of storage. [ Footnote: ... ]
Date: 2023-09-15.21:51:11

Suggested resolution [SUPERSEDED]:

Change in 6.7.2 [intro.object] paragraph 9 as follows:

... Two objects with overlapping lifetimes that are not bit-fields may have the same address if one is nested within the other, or if at least one is a subobject of zero size and they are of different types (ignoring top-level cv-qualifiers); otherwise, they have distinct addresses and occupy disjoint bytes of storage. [ Footnote: ... ]
Date: 2023-11-15.00:00:00

[Accepted as a DR at the November, 2023 meeting.]

Subclause 6.7.2 [intro.object] paragraph 9 specifies:

... Two objects with overlapping lifetimes that are not bit-fields may have the same address if one is nested within the other, or if at least one is a subobject of zero size and they are of different types; otherwise, they have distinct addresses and occupy disjoint bytes of storage. [ Footnote: ... ]

Types T and const T are different types, but it is unlikely the rule is intending to differentiate along that line.

History
Date User Action Args
2024-04-05 21:43:46adminsetstatus: dr -> drwp
2023-12-19 10:15:28adminsetstatus: ready -> dr
2023-12-02 15:54:05adminsetstatus: tentatively ready -> ready
2023-09-15 21:51:11adminsetmessages: + msg7433
2023-09-15 21:51:11adminsetstatus: open -> tentatively ready
2023-09-05 20:07:55adminsetmessages: + msg7423
2023-09-04 00:00:00admincreate