Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,
typename MetaFun::template apply<T1, T2>
Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,
typename T::type::type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68166 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/TemplateName.cpp b/lib/AST/TemplateName.cpp
index 659796d..16b96a0 100644
--- a/lib/AST/TemplateName.cpp
+++ b/lib/AST/TemplateName.cpp
@@ -38,16 +38,18 @@
return true;
}
-void TemplateName::print(llvm::raw_ostream &OS) const {
+void TemplateName::print(llvm::raw_ostream &OS, bool SuppressNNS) const {
if (TemplateDecl *Template = Storage.dyn_cast<TemplateDecl *>())
OS << Template->getIdentifier()->getName();
else if (QualifiedTemplateName *QTN = getAsQualifiedTemplateName()) {
- QTN->getQualifier()->print(OS);
+ if (!SuppressNNS)
+ QTN->getQualifier()->print(OS);
if (QTN->hasTemplateKeyword())
OS << "template ";
OS << QTN->getTemplateDecl()->getIdentifier()->getName();
} else if (DependentTemplateName *DTN = getAsDependentTemplateName()) {
- DTN->getQualifier()->print(OS);
+ if (!SuppressNNS)
+ DTN->getQualifier()->print(OS);
OS << "template ";
OS << DTN->getName()->getName();
}