[PATCH] D16308: clang-tidy Enhance readability-simplify-boolean-expr check to handle implicit conversions of integral types to bool and member pointers

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 04:49:45 PST 2016


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM!


================
Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:366
@@ +365,3 @@
+      binaryOperator(
+          isExpansionInMainFile(), hasOperatorName(OperatorName),
+          hasLHS(allOf(
----------------
Sorry for not noticing this earlier, but since we have two other in-flight patches I reviewed this morning, it caught my attention: we should not be using isExpansionInMainFile, but instead testing the source location of the matches to see if they're in a macro expansion. This is usually done with something like `Result.SourceManager->isMacroBodyExpansion(SomeLoc)`.

I realize this is existing code and not your problem, but it should be fixed in a follow-on patch (by someone) and include some macro test cases.


http://reviews.llvm.org/D16308





More information about the cfe-commits mailing list