================
@@ -174,13 +174,41 @@ bool shouldTrackImplicitObjectArg(const CXXMethodDecl
*Callee,
}
bool shouldTrackFirstArgument(const FunctionDecl *FD) {
- if (!FD->getIdentifier() || FD->getNumParams() != 1)
+ if (!FD->getIdentifier() || FD->getNumParams() < 1)
return false;
+ if (!FD->isInStdNamespace())
+ return false;
+ // Track std:: algorithm functions that return an iterator whose lifetime is
+ // bound to the first argument.
+ if (FD->getNumParams() >= 2 && FD->isInStdNamespace() &&
+ isGslPointerType(FD->getReturnType())) {
+ if (llvm::StringSwitch<bool>(FD->getName())
+ .Cases(
+ {
+ "find",
----------------
usx95 wrote:
As much as we can I guess. I can add more in follow ups. Feel free to suggest
more.
https://github.com/llvm/llvm-project/pull/179227
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits