aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-14 23:26:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-14 23:26:13 +0000
commit54dabfca850ca9e60e9ffb60003529f868d4d127 (patch)
tree8e9ea9e3574c06f8bc4d4a67caaf42a967da3154 /lib/Sema/SemaTemplate.cpp
parent77b7f1d4fb782c9152f91b76f9f8b1d1af21bd35 (diff)
Introduce basic support for instantiating the definitions of member
functions of class templates. Only compound statements and expression statements are currently implemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71814 91177308-0d34-0410-b5e6-96231b3b80d8
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