summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.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
commit8567358cc9e04823bba9773e6509060c45b9ed80 (patch)
treeaba1ab94a17b76c46ade73fd32dc037cf20220b5 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentf811647c27a51efbd1ff70e6355820b261df37f9 (diff)
downloadbcm5719-llvm-8567358cc9e04823bba9773e6509060c45b9ed80.tar.gz
bcm5719-llvm-8567358cc9e04823bba9773e6509060c45b9ed80.zip
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. llvm-svn: 72015
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 0c13027864e..c08841abaa0 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/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));
OpenPOWER on IntegriCloud