This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


617. Lvalue-to-rvalue conversions of uninitialized char objects

Section: 7.3.2  [conv.lval]     Status: NAD     Submitter: Alan Stokes     Date: 6 February 2007

According to 7.3.2 [conv.lval] paragraph 1, applying the lvalue-to-rvalue conversion to any uninitialized object results in undefined behavior. However, character types are intended to allow any data, including uninitialized objects and padding, to be copied (hence the statements in 6.8.2 [basic.fundamental] paragraph 1 that “For character types, all bits of the object representation participate in the value representation” and in 7.2.1 [basic.lval] paragraph 15 that char and unsigned char types can alias any object). The lvalue-to-rvalue conversion should be permitted on uninitialized objects of character type without evoking undefined behavior.

Rationale (February, 2021):

The Standard now clearly specifies the handling of indeterminate values for unsigned char and std::byte types; see 6.7.4 [basic.indet].