================
@@ -1020,12 +1020,13 @@ void FactsGenerator::handleLifetimeCaptureBy(const 
FunctionDecl *FD,
   if (isa<CXXConstructorDecl>(FD))
     return;
   const auto *Method = dyn_cast<CXXMethodDecl>(FD);
-  bool IsInstance =
-      Method && Method->isInstance() && !isa<CXXConstructorDecl>(FD);
-  auto getArgCaptureBy = [FD,
-                          IsInstance](unsigned I) -> LifetimeCaptureByAttr * {
+  bool HasImplicitThisParam =
+      Method && Method->isImplicitObjectMemberFunction() &&
+      !isa<CXXConstructorDecl>(FD);
+  auto getArgCaptureBy =
+      [FD, HasImplicitThisParam](unsigned I) -> LifetimeCaptureByAttr * {
     const ParmVarDecl *PVD = nullptr;
-    if (IsInstance) {
+    if (HasImplicitThisParam) {
----------------
usx95 wrote:

I think this is indeed a useful change but I would appreciate if we can focus 
on the root cause in this PR and move this to a separate PR.

https://github.com/llvm/llvm-project/pull/212264
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to