Title
Object representation of a bit-field
Status
drafting
Section
6.8.1 [basic.types.general]
Submitter
Jiang An

Created on 2022-01-20.00:00:00 last changed 2 weeks ago

Messages

Date: 2022-09-25.18:08:42

6.7.2 [intro.object] clearly implies that bit-fields are objects; paragraphs 8-9 contain phrases like “unless an object is a bit-field...” and “a non-bit-field subobject”. However, the definition of “object representation” in 6.8.1 [basic.types.general] paragraph 4 is,

The object representation of an object of type T is the sequence of N unsigned char objects taken up by the object of type T, where N equals sizeof(T).

and thus fails to address bit-fields, which are not necessarily composed of a sequence of complete bytes.

The C Standard (6.2.6.1 paragraph 4) says,

Values stored in bit-fields consist of m bits, where m is the size specified for the bit-field. The object representation is the set of m bits the bit-field comprises in the addressable storage unit holding it.

Presumably similar wording could be adopted for C++.

History
Date User Action Args
2022-11-20 07:54:16adminsetstatus: open -> drafting
2022-01-20 00:00:00admincreate