[clang-tools-extra] [clang-tidy] Correcting fix suggestion in `readability-simplify-boolean-expr` (PR #178392)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 28 06:06:30 PST 2026


=?utf-8?q?Björn?= Svensson <bjorn.a.svensson at est.tech>,
=?utf-8?q?Björn?= Svensson <bjorn.a.svensson at est.tech>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/178392 at github.com>


================
@@ -162,7 +162,8 @@ static std::string replacementExpression(const ASTContext &Context,
   if (const auto *EC = dyn_cast<ExprWithCleanups>(E))
     E = EC->getSubExpr();
 
-  const bool NeedsStaticCast = needsStaticCast(E);
+  const bool NeedsStaticCast =
+      (Context.getLangOpts().CPlusPlus) ? needsStaticCast(E) : false;
----------------
zeyi2 wrote:

Nit: 

```suggestion
       Context.getLangOpts().CPlusPlus && needsStaticCast(E);
```

https://github.com/llvm/llvm-project/pull/178392


More information about the cfe-commits mailing list