================ @@ -377,8 +377,12 @@ struct ConvertConstructorToDeductionGuideTransform { if (NestedPattern) Args.addOuterRetainedLevels(NestedPattern->getTemplateDepth()); auto [Depth, Index] = getDepthAndIndex(Param); + assert(Depth || + cast<ClassTemplateSpecializationDecl>(FTD->getDeclContext()) + ->isExplicitSpecialization()); NamedDecl *NewParam = transformTemplateParameter( - SemaRef, DC, Param, Args, Index + Depth1IndexAdjustment, Depth - 1); + SemaRef, DC, Param, Args, Index + Depth1IndexAdjustment, + Depth ? Depth - 1 : 0); ---------------- hokein wrote:
IIUC, for fully explicit specializations where the template parameter list is empty `<>`, they don't contribute to the depth. This makes me think we should use `Depth` directly if `FTD->getDeclContext()` is an explicit specialization? Would it be possible the Depth is not 0 in that case? an explicit template specialization is inside a template class? https://github.com/llvm/llvm-project/pull/128704 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits