[PATCH] D23820: Do not warn about format strings that are indexed string literals.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 13 18:25:09 PDT 2016
rsmith added inline comments.
================
Comment at: lib/Sema/SemaChecking.cpp:3864-3867
@@ +3863,6 @@
+ ResOffset = Offset.sadd_ov(Addend, Ov);
+ else if (AddendIsRight && BinOpKind == BO_Sub)
+ ResOffset = Offset.ssub_ov(Addend, Ov);
+ else
+ assert(AddendIsRight && BinOpKind == BO_Sub &&
+ "operator must be add or sub with addend on the right");
----------------
The suggestion was to remove the condition in the `else if` and put the assertion inside its body, rather than duplicating it here:
if (BinOpKind == BO_Add)
// handle add
else {
assert(it's a subtract);
// handle sub
}
https://reviews.llvm.org/D23820
More information about the cfe-commits
mailing list