================ @@ -18770,12 +18832,6 @@ bool Sema::tryCaptureVariable( if (CapturingFunctionScopes == 0 && (!BuildAndDiagnose || VarDC == DC)) return true; - // Exception: Function parameters are not tied to the function's DeclContext - // until we enter the function definition. Capturing them anyway would result - // in an out-of-bounds error while traversing DC and its parents. - if (isa<ParmVarDecl>(Var) && !VarDC->isFunctionOrMethod()) ---------------- zyn0217 wrote:
I think the rationale behind it is that every ParmVarDecl now has a context decl pointing to e.g. its function? Do we still need to set the ParmVarDecl's context separately (by calling `setOwningFunction`) now? Sorry I haven't gotten around to the changes on VarDecls yet. https://github.com/llvm/llvm-project/pull/107942 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits