[clang] [LifetimeSafety] Add support for iterator arithmetic (PR #195442)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 07:11:09 PDT 2026


================
@@ -230,6 +241,19 @@ bool shouldTrackFirstArgument(const FunctionDecl *FD) {
   return false;
 }
 
+bool shouldTrackSecondArgument(const FunctionDecl *FD) {
+  if (FD->getNumParams() < 2)
+    return false;
+  const auto *RD = FD->getParamDecl(1)->getType()->getAsCXXRecordDecl();
+  if (!RD)
+    return false;
+  return RD->hasAttr<PointerAttr>() &&
----------------
usx95 wrote:

Consider briefly documenting this.

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


More information about the cfe-commits mailing list