outer levels as retained rather than omitting their arguments.
This better reflects what's going on (we're performing a substitution
while still inside a template). In theory this is also more correct, but
I've not found a testcase where it matters in practice (largely because
we don't allow alias templates to be declared inside a function).
// Only substitute for the innermost template argument list.
MultiLevelTemplateArgumentList TemplateArgLists;
TemplateArgLists.addOuterTemplateArguments(&StackTemplateArgs);
- unsigned Depth = AliasTemplate->getTemplateParameters()->getDepth();
- for (unsigned I = 0; I < Depth; ++I)
- TemplateArgLists.addOuterTemplateArguments(None);
+ TemplateArgLists.addOuterRetainedLevels(
+ AliasTemplate->getTemplateParameters()->getDepth());
LocalInstantiationScope Scope(*this);
InstantiatingTemplate Inst(*this, TemplateLoc, Template);