aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 1453dcfe5e..6f65288164 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -2391,27 +2391,19 @@ Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
}
}
- // Find the enclosing template, because we need its template
- // arguments to instantiate this class.
- DeclContext *EnclosingTemplateCtx = Record->getDeclContext();
- while (!isa<ClassTemplateSpecializationDecl>(EnclosingTemplateCtx))
- EnclosingTemplateCtx = EnclosingTemplateCtx->getParent();
- ClassTemplateSpecializationDecl *EnclosingTemplate
- = cast<ClassTemplateSpecializationDecl>(EnclosingTemplateCtx);
-
if (!Record->getDefinition(Context)) {
// If the class has a definition, instantiate it (and all of its
// members, recursively).
Pattern = cast_or_null<CXXRecordDecl>(Pattern->getDefinition(Context));
if (Pattern && InstantiateClass(TemplateLoc, Record, Pattern,
- EnclosingTemplate->getTemplateArgs(),
+ getTemplateInstantiationArgs(Record),
/*ExplicitInstantiation=*/true))
return true;
} else {
// Instantiate all of the members of class.
InstantiatingTemplate Inst(*this, TemplateLoc, Record);
InstantiateClassMembers(TemplateLoc, Record,
- EnclosingTemplate->getTemplateArgs());
+ getTemplateInstantiationArgs(Record));
}
// FIXME: We don't have any representation for explicit