https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114537

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Fedor Chelnokov from comment #1)
> Probably related:
> ```
> #include <bit>
> 
> struct A { int a: 7; };
> 
> static_assert( 1 == std::bit_cast<A>(std::bit_cast<int>(A{1})).a );
> ```
> It looks valid and accepted by MSVC, but GCC prints:
> error: '__builtin_bit_cast' accessing uninitialized byte at offset 0
> 
> Online demo: https://gcc.godbolt.org/z/3W5onY955

That is unrelated and gcc is actually correct there see pr 99637.

Reply via email to