diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-18 17:01:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-18 17:01:57 +0000 |
commit | f3e7ce4bd9837cdab6a096235922865f95467d3d (patch) | |
tree | 3724a95527ff3f62ba286d42b7570b02a8acfd99 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 85a3b03f83f4072e3eda9f0ad40c08a0c28785d3 (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/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 0c13027864..c08841abaa 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -574,7 +574,8 @@ TemplateDeclInstantiator::InitMethodInstantiation(CXXMethodDecl *New, /// /// \param Function the already-instantiated declaration of a /// function. -void Sema::InstantiateFunctionDefinition(FunctionDecl *Function) { +void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, + FunctionDecl *Function) { // FIXME: make this work for function template specializations, too. if (Function->isInvalidDecl()) @@ -590,7 +591,9 @@ void Sema::InstantiateFunctionDefinition(FunctionDecl *Function) { if (!Pattern) return; - // FIXME: add to the instantiation stack. + InstantiatingTemplate Inst(*this, PointOfInstantiation, Function); + if (Inst) + return; ActOnStartOfFunctionDef(0, DeclPtrTy::make(Function)); |