summaryrefslogtreecommitdiffstats
path: root/lib/AST/TemplateName.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-31 18:38:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-31 18:38:02 +0000
commitde650ae96b53eb6109f29fdb5ee51c514259e6e4 (patch)
treec8110a61def8698d6cda53263f62e0e61a7808c9 /lib/AST/TemplateName.cpp
parentf8c4f5469d7db591eeacfc3381d91f773fb7af43 (diff)
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
Diffstat (limited to 'lib/AST/TemplateName.cpp')
-rw-r--r--lib/AST/TemplateName.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/TemplateName.cpp b/lib/AST/TemplateName.cpp
index 4e54fe4955..3659e2350d 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 @@ void TemplateName::Print(llvm::raw_ostream &OS) const {
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());
+}