Title
Are bit-field and non-bit-field members layout compatible?
Status
cd2
Section
11.4 [class.mem]
Submitter
Alan Stokes

Created on 2007-08-09.00:00:00 last changed 178 months ago

Messages

Date: 2009-03-15.00:00:00

[Voted into the WP at the March, 2009 meeting.]

Date: 2008-09-15.00:00:00

Proposed Resolution (September, 2008):

Change 11.4 [class.mem] paragraph 18 as follows:

... Two standard-layout structs share a common initial sequence if corresponding members have layout-compatible types (and, for bit-fields, the same widths) and either neither member is a bit-field or both are bit-fields with the same widths for a sequence of one or more initial members.
Date: 2007-08-09.00:00:00

The current wording defining a “common initial sequence” in 11.4 [class.mem] paragraph 17 does not address the case in which one member is a bit-field and the corresponding member is not:

Two standard-layout structs share a common initial sequence if corresponding members have layout-compatible types (and, for bit-fields, the same widths) for a sequence of one or more initial members.

Presumably the intent was something like, “(and, if one of the pair is a bit-field, the other is also a bit-field of the same width).”

History
Date User Action Args
2010-03-29 00:00:00adminsetstatus: wp -> cd2
2009-08-03 00:00:00adminsetstatus: dr -> wp
2009-03-23 00:00:00adminsetmessages: + msg2026
2009-03-23 00:00:00adminsetstatus: ready -> dr
2008-10-05 00:00:00adminsetstatus: review -> ready
2008-02-03 00:00:00adminsetmessages: + msg1581
2008-02-03 00:00:00adminsetstatus: drafting -> review
2007-10-09 00:00:00adminsetstatus: open -> drafting
2007-08-09 00:00:00admincreate