================ @@ -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()) ---------------- mizvekov wrote:
We still do need to reparent them the old way, but this is going to change once I give them a ContextDecl too. The difference right now is that we don't create the ParmVarDecls always at the translation unit context anymore, we just create them at the CurContext. 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