aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-18 17:01:57 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-18 17:01:57 +0000
commitf3e7ce4bd9837cdab6a096235922865f95467d3d (patch)
tree3724a95527ff3f62ba286d42b7570b02a8acfd99 /lib/Sema/SemaTemplate.cpp
parent85a3b03f83f4072e3eda9f0ad40c08a0c28785d3 (diff)
When instantiating the definition of a member function of a class
template, introduce that member function into the template instantiation stack. Also, add diagnostics showing the member function within the instantiation stack and clean up the qualified-name printing so that we get something like: note: in instantiation of member function 'Switch1<int, 2, 2>::f' requested here in the template instantiation backtrace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 79d7e2c9ae..47388ace34 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -2340,11 +2340,8 @@ Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
// instantiation.
if (SpecializationRequiresInstantiation)
InstantiateClassTemplateSpecialization(Specialization, true);
- else {
- // Instantiate the members of this class template specialization.
- InstantiatingTemplate Inst(*this, TemplateLoc, Specialization);
+ else // Instantiate the members of this class template specialization.
InstantiateClassTemplateSpecializationMembers(TemplateLoc, Specialization);
- }
return DeclPtrTy::make(Specialization);
}
@@ -2405,12 +2402,9 @@ Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
getTemplateInstantiationArgs(Record),
/*ExplicitInstantiation=*/true))
return true;
- } else {
- // Instantiate all of the members of class.
- InstantiatingTemplate Inst(*this, TemplateLoc, Record);
+ } else // Instantiate all of the members of class.
InstantiateClassMembers(TemplateLoc, Record,
getTemplateInstantiationArgs(Record));
- }
// FIXME: We don't have any representation for explicit instantiations of
// member classes. Such a representation is not needed for compilation, but it