[clang-tools-extra] [clang-tidy] Correcting fix suggestion in `readability-simplify-boolean-expr` (PR #178392)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 31 08:48:17 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>,
=?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);
----------------
vbvictor wrote:
So casting is never needed for `C` code?
Maybe we should introduce `(bool)(...)` cast instead of `static_cast<>(...)` for C code?
https://github.com/llvm/llvm-project/pull/178392
More information about the cfe-commits
mailing list