================ @@ -567,6 +567,58 @@ bool Sema::addInstantiatedCapturesToScope( return false; } +static void addDeclsFromParentScope(Sema &S, FunctionDecl *FD, + LocalInstantiationScope &Scope) { + assert(isLambdaCallOperator(FD) && "FD must be a lambda call operator"); + + LambdaScopeInfo *LSI = cast<LambdaScopeInfo>(S.getFunctionScopes().back()); + + auto captureVar = [&](VarDecl *VD) { + LSI->addCapture(VD, /*isBlock=*/false, /*isByref=*/false, + /*isNested=*/false, VD->getBeginLoc(), SourceLocation(), + VD->getType(), /*Invalid=*/false); + }; + + FD = dyn_cast<FunctionDecl>(FD->getParent()->getParent()); ---------------- cor3ntin wrote:
you could use `getLambdaAwareParentOfDeclContext(FD)` here https://github.com/llvm/llvm-project/pull/65193 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits