aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-02 23:24:31 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-02 23:24:31 +0000
commit37d93e9252026d4fb836d9c05d0122a2d46e56be (patch)
treea9a5675cae564a3200523938dee0de40859d4a97 /lib/Sema/SemaTemplateInstantiate.cpp
parentc43f2f4340cd8b6bbf0cbc955d613c5a96388b85 (diff)
Keep track of the template arguments deduced when matching a class
template partial specialization. Then, use those template arguments when instantiating members of that class template partial specialization. Fixes PR4607. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index cb43f1c6a0..ae16c7124c 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -32,7 +32,7 @@ Sema::getTemplateInstantiationArgs(NamedDecl *D) {
// Template arguments for a class template specialization.
if (ClassTemplateSpecializationDecl *Spec
= dyn_cast<ClassTemplateSpecializationDecl>(D))
- return Spec->getTemplateArgs();
+ return Spec->getTemplateInstantiationArgs();
// Template arguments for a function template specialization.
if (FunctionDecl *Function = dyn_cast<FunctionDecl>(D))
@@ -50,7 +50,7 @@ Sema::getTemplateInstantiationArgs(NamedDecl *D) {
ClassTemplateSpecializationDecl *EnclosingTemplate
= cast<ClassTemplateSpecializationDecl>(EnclosingTemplateCtx);
- return EnclosingTemplate->getTemplateArgs();
+ return EnclosingTemplate->getTemplateInstantiationArgs();
}
Sema::InstantiatingTemplate::
@@ -1011,6 +1011,7 @@ Sema::InstantiateClassTemplateSpecialization(
// instantiation is generated from that specialization.
Pattern = Matched[0].first;
TemplateArgs = Matched[0].second;
+ ClassTemplateSpec->setInstantiationOf(Matched[0].first, Matched[0].second);
} else if (Matched.size() > 1) {
// -- If more than one matching specialization is found, the
// partial order rules (14.5.4.2) are used to determine