[PATCH] Add readability-simplify-boolean-expr check to clang-tidy

Alexander Kornienko alexfh at google.com
Fri Apr 10 12:09:27 PDT 2015


================
Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:105
@@ +104,3 @@
+  }
+  assert(!"Non-negatable operator given to negatedOperator");
+  return BinOp->getOpcodeStr();
----------------
alexfh wrote:
> nit: This style seems to be more common in LLVM and more idiomatic: `assert(false && "...")`.
This function can replace isNegatable, if it returns an empty StringRef instead of asserting. It will result in less code duplication.

http://reviews.llvm.org/D7648

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list