[PATCH] Enhance clang-tidy readability-simplify-boolean-expr check to handle chained conditional assignment and chained conditional return
Richard
legalize at xmission.com
Sat May 16 17:14:20 PDT 2015
================
Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:208
@@ +207,3 @@
+ if (ChainedConditionalReturn) {
+ Finder->addMatcher(ifStmt(isExpansionInMainFile(),
+ hasThen(ReturnsBool(Value, ThenLiteralId)),
----------------
alexfh wrote:
> I guess I missed this in the initial code review.
>
> Using `isExpansionInMainFile()` you disable fixes in headers which is sub-optimal. I think we should disable fixes in macros (and when a `true` or `false` comes from a macro) in a different way: check the relevant source location for being a file location (`SourceLocation::isFileID`).
>
> This is fine for a follow up.
I will address this in a subsequent refinement.
http://reviews.llvm.org/D8996
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list