[clang] [llvm] clang: fix lifetime_capture_by indexing for member functions (PR #212264)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 29 05:53:42 PDT 2026


================
@@ -1048,11 +1046,13 @@ void FactsGenerator::handleLifetimeCaptureBy(const FunctionDecl *FD,
           CapturingArgIdx == LifetimeCaptureByAttr::Unknown ||
           CapturingArgIdx == LifetimeCaptureByAttr::Invalid)
         continue;
-      ArrayRef<const Expr *> CallArgs = IsInstance ? Args.drop_front() : Args;
+      if (CapturingArgIdx == LifetimeCaptureByAttr::This &&
+          isa<CXXConstructorDecl>(FD))
+        continue;
----------------
NeKon69 wrote:

I don't think we will need this if we keep the check above.

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


More information about the cfe-commits mailing list