aaron.ballman added a comment.

In general, I think this is a good approach. However, it sort of kicks the can 
down the road a bit; we will still overflow the member if there are enough 
fields. Would it make sense to also add a diagnostic to Sema so that overflow 
with the widened fields is diagnosed rather than causing a crash?



================
Comment at: clang/include/clang/AST/Stmt.h:603
 
-    // These don't need to be particularly wide, because they're
-    // strictly limited by the forms of expressions we permit.
-    unsigned NumSubExprs : 8;
-    unsigned ResultIndex : 32 - 8 - NumExprBits;
+    // Whether the PseudoObjectExpr has result.
+    unsigned HasResult : 1;
----------------



================
Comment at: clang/test/SemaCXX/builtin-dump-struct.cpp:163
+
+// Check that PseudoObjectExprBitfields:NumSubExprs doesn't overflow.
+struct t1 {
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154784/new/

https://reviews.llvm.org/D154784

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to