[PATCH] D10018: C11 _Bool bitfield diagnostic

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 12:54:09 PDT 2015


hubert.reinterpretcast added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:12613
@@ +12612,3 @@
+        FieldTy->isBooleanType() &&
+        Value.getZExtValue() > 1) {
+      if (FieldName)
----------------
rsmith wrote:
> This will assert if the specified bitfield width doesn't fit in 64 bits. You can use `Value.ugt(1)` instead.
> 
> The check above for `TypeSize` has the same bug. This testcase causes an assertion to fire:
> 
>   struct X { int n : 0xffffffff * (__int128)0xffffffff * 0xffffffff; };
I think this is PR 23505.


http://reviews.llvm.org/D10018





More information about the cfe-commits mailing list