Created on 2025-03-20.00:00:00 last changed 1 week ago
Additional notes (June, 2025)
The "underlying type" is for enumerations and derived integer types and thus is the wrong phrase to use here.
Proposed resolution (no objections during CWG reflector review starting 2025-05-11):
Change in 6.7.3 [basic.align] paragraph 6 as follows:
The alignment requirement of a complete type can be queried using an alignof expression (7.6.2.6 [expr.alignof]). Furthermore, the narrow character types (6.8.2 [basic.fundamental]) shall have the weakest alignment requirement. [Note 2:This enables the ordinary character types toThe type unsigned char can be used as the underlying type for an aligned memory area (9.13.2 [dcl.align]). —end note]
(From submission #687.)
Subclause 6.7.3 [basic.align] paragraph 6 specifies:
The alignment requirement of a complete type can be queried using an alignof expression (7.6.2.6 [expr.alignof]). Furthermore, the narrow character types (6.8.2 [basic.fundamental]) shall have the weakest alignment requirement. [Note 2: This enables the ordinary character types to be used as the underlying type for an aligned memory area (9.13.2 [dcl.align]). —end note]
The note has multiple problems: First, the note talks about "ordinary character types" (including char8_t; see 6.8.2 [basic.fundamental] paragraph 7), whereas the immediately preceding sentence is limited to "narrow character types". Second, due to memory model concerns, signed char is not suitable for aligned memory areas providing storage for other objects.
History | |||
---|---|---|---|
Date | User | Action | Args |
2025-06-20 12:07:56 | admin | set | messages: + msg8041 |
2025-06-20 12:07:56 | admin | set | status: tentatively ready -> drafting |
2025-06-12 22:26:13 | admin | set | messages: + msg8035 |
2025-06-12 22:26:13 | admin | set | status: open -> tentatively ready |
2025-03-20 00:00:00 | admin | create |