[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 11 14:51:55 PDT 2023
================
@@ -6171,6 +6171,11 @@ def warn_signed_bitfield_enum_conversion : Warning<
"signed bit-field %0 needs an extra bit to represent the largest positive "
"enumerators of %1">,
InGroup<BitFieldEnumConversion>, DefaultIgnore;
+def warn_bitfield_too_small_for_integral_type : Warning<
+ "conversion from %2 (%3 bits) to bit-field %0 (%1 bits) may change value">,
+ InGroup<BitFieldConversion>, DefaultIgnore;
+def note_bitfield_assign : Note<
+ "Bit-field %0 (%1 bits) is too narrow to store assigned value %2 (%3 bits)">;
----------------
vabridgers wrote:
I believe the comments have been resolved. Please let me know if there's anything else to do here. Thank you!
https://github.com/llvm/llvm-project/pull/68276
More information about the cfe-commits
mailing list