================ @@ -3061,11 +3062,19 @@ bool Sema::SubstDefaultArgument( /*ForDefinition*/ false); if (addInstantiatedParametersToScope(FD, PatternFD, *LIS, TemplateArgs)) return true; + if (FD->isOutOfLine()) { + TemplateArgumentList *CurrentTemplateArgumentList = + TemplateArgumentList::CreateCopy(getASTContext(), + TemplateArgs.getInnermost()); + NewTemplateArgs = getTemplateInstantiationArgs( + FD, FD->getDeclContext(), /*Final=*/false, + CurrentTemplateArgumentList, /*RelativeToPrimary=*/true); + } } runWithSufficientStackSpace(Loc, [&] { - Result = SubstInitializer(PatternExpr, TemplateArgs, - /*DirectInit*/false); + Result = SubstInitializer(PatternExpr, NewTemplateArgs, + /*DirectInit*/ false); ---------------- shafik wrote:
`/*DirectInit=*/false)` https://github.com/llvm/llvm-project/pull/78400 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits