Index: clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -195,6 +195,9 @@ std::string replacementExpression(const MatchFinder::MatchResult &Result, bool Negated, const Expr *E) { E = E->ignoreParenBaseCasts(); + if (const auto *EC = dyn_cast(E)) + E = EC->getSubExpr(); + const bool NeedsStaticCast = needsStaticCast(E); if (Negated) { if (const auto *UnOp = dyn_cast(E)) { Index: clang-tools-extra/trunk/test/clang-tidy/readability-simplify-bool-expr.cpp =================================================================== --- clang-tools-extra/trunk/test/clang-tidy/readability-simplify-bool-expr.cpp +++ clang-tools-extra/trunk/test/clang-tidy/readability-simplify-bool-expr.cpp @@ -938,3 +938,13 @@ } // CHECK-MESSAGES: :[[@LINE-5]]:12: warning: {{.*}} in conditional return // CHECK-FIXES: return p->m != 0;{{$}} + +bool operator!=(const A&, const A&) { return false; } +bool expr_with_cleanups(A &S) { + if (S != (A)S) + return false; + + return true; +} +// CHECK-MESSAGES: :[[@LINE-4]]:12: warning: {{.*}} in conditional return +// CHECK-FIXES: S == (A)S;{{$}}