Index: clang-tidy/readability/SimplifyBooleanExprCheck.cpp =================================================================== --- clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -75,6 +75,8 @@ bool needsParensAfterUnaryNegation(const Expr *E) { E = E->IgnoreImpCasts(); + if (auto *EC = dyn_cast(E)) + E = EC->getSubExpr(); if (isa(E) || isa(E)) return true; Index: test/clang-tidy/readability-simplify-bool-expr.cpp =================================================================== --- test/clang-tidy/readability-simplify-bool-expr.cpp +++ test/clang-tidy/readability-simplify-bool-expr.cpp @@ -938,3 +938,15 @@ } // CHECK-MESSAGES: :[[@LINE-5]]:12: warning: {{.*}} in conditional return // CHECK-FIXES: return p->m != 0;{{$}} + +bool operator!=(const A&, const A&) { return false; } +extern bool GetValue(A s); +bool expr_with_cleanups(A &s) { + A S; + if (GetValue(s) && S != (A)s) + return false; + + return true; +} +// CHECK-MESSAGES: :[[@LINE-4]]:12: warning: {{.*}} in conditional return +// CHECK-FIXES: !(GetValue(s) && S != (A)s);{{$}}