Prazek added inline comments.

================
Comment at: clang-tidy/modernize/UseBoolLiteralsCheck.cpp:38-43
@@ +37,8 @@
+              unless(isInTemplateInstantiation()))),
+          anyOf(hasTrueExpression(ignoringParenImpCasts(
+                    integerLiteral().bind("trueBranchLiteral"))),
+                anything()),
+          anyOf(hasFalseExpression(ignoringParenImpCasts(
+                    integerLiteral().bind("falseBranchLiteral"))),
+                anything())),
+      this);
----------------
Do I understand it correctly, that you have to have this 2 anyOf matchers, 
because if you would have it in one then because anyOf is lazy, it would not 
bind to the second branch?

I think it would be good to write some comment about it, because on the first 
sight it looks like it could be simplified.

================
Comment at: test/clang-tidy/modernize-use-bool-literals.cpp:119
@@ -118,1 +118,3 @@
 }
+
+static int Value = 1;
----------------
Please add a test with only one branch with constant, and none of them.
Also one test like
bool Result = Value == 1 ? true : 0;
or
bool Result = Value == 1 ? false : bool(0);


Repository:
  rL LLVM

https://reviews.llvm.org/D23243



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

Reply via email to