This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
meta::data_member_spec allows negative bit-field widthsSection: 21.4.16 [meta.reflection.define.aggregate] Status: New Submitter: Jakub Jelinek Opened: 2025-10-20 Last modified: 2025-10-20
Priority: Not Prioritized
View other active issues in [meta.reflection.define.aggregate].
View all other issues in [meta.reflection.define.aggregate].
View all issues with New status.
Discussion:
The meta::data_member_spec function doesn't restrict options.bit_width
to be non-negative.
Proposed resolution:
This wording is relative to N5014.
Modify 21.4.16 [meta.reflection.define.aggregate] as indicated:
- (5.3) — if
options.namedoes not contain a value, thenoptions.bit_widthcontains a value;- (5.4) — if
options.bit_widthcontains a value V, then
- (5.4.1) —
is_integral_type(type) || is_enum_type(type)istrue,- (5.4.2) —
options.alignmentdoes not contain a value,- (5.4.3) —
options.no_unique_addressisfalse,and- (5.4.?) — V is not negative, and
- (5.4.4) — if V equals
0, thenoptions.namedoes not contain a value; and- (5.5) — if
options.alignmentcontains a value, it is an alignment value (6.8.3 [basic.align]) not less thanalignment_of(type).