[clang] [LifetimeSafety] Detect use-after-scope through fields in member calls (PR #191731)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 02:07:43 PDT 2026


================
@@ -723,6 +723,17 @@ void FactsGenerator::handleInvalidatingCall(const Expr *Call,
         ThisList->getOuterOriginID(), Call));
 }
 
+void FactsGenerator::handleImplicitObjectFieldUses(const Expr *Call,
+                                                   const FunctionDecl *FD) {
+  const auto *MD = dyn_cast<CXXMethodDecl>(FD);
+  if (!MD || !MD->isInstance())
+    return;
+
+  for (const auto *Field : MD->getParent()->fields())
----------------
Xazax-hun wrote:

I think it is possible that this only iterates through the direct fields but we might not actually do anything for the fields of the derived classes here. 

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


More information about the cfe-commits mailing list