Implement template instantiation for template names, including both
template template parameters and dependent template names. For
example, the oft-mentioned
typename MetaFun::template apply<T1, T2>::type
can now be instantiated, with the appropriate name lookup for "apply".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68128 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/TemplateName.cpp b/lib/AST/TemplateName.cpp
index 4e54fe4..3659e23 100644
--- a/lib/AST/TemplateName.cpp
+++ b/lib/AST/TemplateName.cpp
@@ -14,6 +14,7 @@
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "llvm/Support/raw_ostream.h"
+#include <stdio.h>
using namespace clang;
@@ -52,3 +53,12 @@
OS << DTN->getName()->getName();
}
}
+
+void TemplateName::Dump() const {
+ std::string Result;
+ {
+ llvm::raw_string_ostream OS(Result);
+ Print(OS);
+ }
+ fprintf(stderr, "%s", Result.c_str());
+}