P3969R3 — Fixing std::bit_cast of types with padding bits
Jan Schultke
LEWG
Revisions R3Oct 2026R2Jul 2026R1May 2026R0Feb 2026
When bit-casting a type containing padding bits to a type with no padding bits, `std::bit_cast` degenerates into an alternative spelling for `std::unreachable` (some exceptions apply). To prevent this inadvertent footgun, this proposal makes that degenerate form of `std::bit_cast` ill-formed.