summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.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/AST/Decl.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/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index c62c1e2b0ea..20fe39d0af5 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -212,7 +212,15 @@ std::string NamedDecl::getQualifiedNameAsString() const {
// scope class/struct/union. How do we handle this case?
break;
- if (const NamedDecl *ND = dyn_cast<NamedDecl>(Ctx))
+ if (const ClassTemplateSpecializationDecl *Spec
+ = dyn_cast<ClassTemplateSpecializationDecl>(Ctx)) {
+ const TemplateArgumentList &TemplateArgs = Spec->getTemplateArgs();
+ std::string TemplateArgsStr
+ = TemplateSpecializationType::PrintTemplateArgumentList(
+ TemplateArgs.getFlatArgumentList(),
+ TemplateArgs.flat_size());
+ Names.push_back(Spec->getIdentifier()->getName() + TemplateArgsStr);
+ } else if (const NamedDecl *ND = dyn_cast<NamedDecl>(Ctx))
Names.push_back(ND->getNameAsString());
else
break;
OpenPOWER on IntegriCloud