Paper HistoryP3969

Fixing std::bit_cast of types with padding bits

R22026-07Post-Brno

Paperweight: Medium

The evidence provides a clear standardization need by showing that the proposed change requires normative wording changes to the C++ standard and cannot be achieved through external artifacts alone.

  • The proposal modifies the Mandates element of std::bit_cast in the standard, which is a normative requirement that only the standard can impose on conforming implementations.
  • The evidence shows that the degenerate form of std::bit_cast currently contains unconditional undefined behavior that compilers do not diagnose, and the proposal would make this ill-formed through a static_assert requirement.
  • The paper documents that LEWG and EWG gave contradictory feedback on alternative approaches, demonstrating that resolving this issue requires the standardization process to establish a single normative behavior.