================
@@ -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);
----------------
bjosv wrote:

The output from the fixer for C23 gets very similar to the output for C++ when 
skipping the cast.
I also ran this version on the added testcode to check for any warnings in the 
fixer-result, and it seems to work fine without C-casts in 
[godbolt](https://godbolt.org/z/dM3n1dEEs) as well. 



https://github.com/llvm/llvm-project/pull/178392
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to