rsmith added inline comments.

================
Comment at: clang/lib/AST/ExprConstant.cpp:5498-5500
     Result.set((Expr*)nullptr, 0, false, true, Offset);
+    Result.getLValueDesignator() =
+        SubobjectDesignator(E->getType()->getPointeeType());
----------------
This is the only caller of `set()` that passes more than three arguments (that 
is, the only caller that passes `true` as `IsNullPtr_`). It seems that such 
calls would always be unsafe / wrong, so I think we can do better than this.

How about this: split `set()` into two functions: for one of them, remove the 
last two parameters (`IsNullPtr_` and `Offset_`), and for the other one, rename 
to `setNull()` and just pass a `QualType` and offset.


https://reviews.llvm.org/D33568



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

Reply via email to