================
@@ -1451,6 +1451,8 @@ void 
Sema::checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD,
     DestinationSize = ComputeSizeArgument(0);
     const Expr *LenArg = TheCall->getArg(1)->IgnoreParenImpCasts();
     const Expr *Dest = TheCall->getArg(0)->IgnoreParenImpCasts();
+    if (const auto *DestCast = dyn_cast_or_null<CastExpr>(Dest))
+      Dest = DestCast->getSubExprAsWritten();
----------------
BgZun wrote:

Now looking at it using`IgnoreParenImplCasts` might be a problem. Since if we 
use something like `snprintf((char*)(char*)a,sizeof(a),...)` no warning will be 
printed. It might be better to use `IgnoreCasts` instead 

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

Reply via email to