[PATCH] D10018: C11 _Bool bitfield diagnostic

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 13:00:39 PDT 2015


hubert.reinterpretcast added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:12586
@@ -12585,3 +12585,3 @@
   if (!FieldTy->isDependentType()) {
     uint64_t TypeSize = Context.getTypeSize(FieldTy);
     if (Value.getZExtValue() > TypeSize) {
----------------
rsmith wrote:
> I think the right way to fix this is to call `getIntWidth` here instead of `getTypeSize`, and finesse our error message to clarify that we're talking about the width of the type (the number of value bits) rather than the size of the type (the number of storage bits).
The implementation of `getIntWidth` currently makes this consideration moot at this time, but should this extend to C89 (aside from the `_Bool` extension)?


http://reviews.llvm.org/D10018





More information about the cfe-commits mailing list