[clang] [LifetimeSafety] Detect use-after-scope through fields in member calls (PR #191731)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 13 23:10:48 PDT 2026
================
@@ -728,6 +728,38 @@ void FactsGenerator::handleInvalidatingCall(const Expr *Call,
ThisList->getOuterOriginID(), Call));
}
+void FactsGenerator::handleImplicitObjectFieldUses(const Expr *Call,
+ const FunctionDecl *FD) {
+ const auto *MemberCall = dyn_cast_or_null<CXXMemberCallExpr>(Call);
+ if (!MemberCall)
+ return;
+
+ if (!isa_and_present<CXXThisExpr>(
+ MemberCall->getImplicitObjectArgument()->IgnoreImpCasts()))
+ return;
+
+ const auto *MD = dyn_cast<CXXMethodDecl>(FD);
+ assert(MD && "Expected MD to be a non-null pointer");
+
----------------
NeKon69 wrote:
If possible, could you please create this as a committable suggestion? I do not think I will be able to change this any time soon today..
https://github.com/llvm/llvm-project/pull/191731
More information about the cfe-commits
mailing list