rsmith added inline comments.
================ Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:1872 QualType Result = getSema().Context.getTemplateTypeParmType( - T->getDepth() - TemplateArgs.getNumSubstitutedLevels(), T->getIndex(), - T->isParameterPack(), NewTTPDecl); + getNewDepth(T->getDepth()), T->getIndex(), T->isParameterPack(), + NewTTPDecl); ---------------- mizvekov wrote: > mark Instead of adding the new `EarlySubstitution` flag and wiring it through everywhere, can you use the existing `MultiLevelTemplateArgumentList::getNewDepth` function? That already handles the case of a depth that's within the number of retained outer levels. We might need to set the number of retained outer levels properly when doing alias template substitution; I'm not sure if we do so currently and I suspect we don't. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127351/new/ https://reviews.llvm.org/D127351 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits