[clang] [LifetimeSafety] Track origins through nested subobject fields (PR #232867)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 13:00:06 PDT 2026


================
@@ -1211,15 +1211,30 @@ void FactsGenerator::handleUse(const Expr *E) {
 // class and its bases. It represents the storage the field refers to, as
 // opposed to the field itself (covered by $this).
 void FactsGenerator::issueFieldPlaceholderLoans(
-    const CXXMethodDecl *MD, llvm::SmallVectorImpl<Fact *> &Facts) {
-  const CXXRecordDecl *ClassDecl = MD->getParent()->getDefinition();
-  if (!ClassDecl)
-    return;
+    const CXXRecordDecl *ClassDef, llvm::SmallVectorImpl<Fact *> &Facts) {
+  assert(ClassDef);
----------------
NeKon69 wrote:

If that check does turn out to be unnecessary, I think it would be nice to have some comment here.

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


More information about the cfe-commits mailing list