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

Richard legalize at xmission.com
Sun Mar 22 11:46:54 PDT 2015


================
Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:244
@@ +243,3 @@
+    replaceWithExpression(Result, NegatedRightRemoved, true, true);
+  } else if (auto TrueConditionRemoved =
+                 getBoolLiteral(Result, ConditionThenStmtId)) {
----------------
alexfh wrote:
> I had to look up what `auto` is here. Let's use `const CXXBoolLiteralExpr *`.
Fixed

================
Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:250
@@ +249,3 @@
+    replaceWithElseStatement(Result, FalseConditionRemoved);
+  } else if (auto *Ternary =
+                 Result.Nodes.getNodeAs<ConditionalOperator>(TernaryId)) {
----------------
alexfh wrote:
> `const auto *`, please.
Fixed

http://reviews.llvm.org/D7648

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






More information about the cfe-commits mailing list