================
@@ -3040,12 +3040,32 @@ void ExprEngine::VisitCommonDeclRefExpr(const Expr *Ex,
const NamedDecl *D,
// Sema follows a sequence of complex rules to determine whether the
// variable should be captured.
if (const FieldDecl *FD = LambdaCaptureFields[VD]) {
- Loc CXXThis = svalBuilder.getCXXThis(MD, SF);
- SVal CXXThisVal = state->getSVal(CXXThis);
- return std::make_pair(state->getLValue(FD, CXXThisVal), FD->getType());
+ if (MD->isImplicitObjectMemberFunction()) {
+ Loc CXXThis = svalBuilder.getCXXThis(MD, SF);
+ SVal CXXThisVal = state->getSVal(CXXThis);
+ return std::make_pair(state->getLValue(FD, CXXThisVal),
+ FD->getType());
+ }
+ const ParmVarDecl *PVD = MD->getParamDecl(0);
+ if (const Expr *CallSite = SF->getCallSite()) {
+ unsigned Idx = PVD->getFunctionScopeIndex();
----------------
benedekaibas wrote:
Yes, it is always zero, but I kept it for myself during development. This can
be removed though for further simplicity.
https://github.com/llvm/llvm-project/pull/219726
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits