================ @@ -633,6 +633,52 @@ def Packed : DiagGroup<"packed", [PackedNonPod]>; def PaddedBitField : DiagGroup<"padded-bitfield">; def Padded : DiagGroup<"padded", [PaddedBitField]>; def UnalignedAccess : DiagGroup<"unaligned-access">; +def MSBitfieldCompatibility : DiagGroup<"ms-bitfield-compatibility"> { + code Documentation = [{ + Under the MS Windows platform ABI, adjacent bit-fields are not packed if the + underlying type has a different storage size. This warning indicates that a + pair of adjacent bit-fields may not pack in the same way due to this behavioural + difference. + + This can occur when mixing different types explicitly: + + .. code-block:: c++ + + struct S { + uint16_t field1 : 1; + uint32_t field2 : 1; + }; + + or more subtly through enums + + .. code-block:: c++ + + enum Enum1 { /* ... */ }; + enum class Enum2 : unsigned char { /* ... */ }; + struct S { + Enum1 field1 : 1; + Enum2 field2 : 1; + }; + + In each of these cases under the MS Windows platform ABI the second bit-field ---------------- ojhunt wrote:
Fixed https://github.com/llvm/llvm-project/pull/117428 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits