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



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

Reply via email to