summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/ast-dump-templates.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-05-14 21:04:00 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-05-14 21:04:00 +0000
commitd4da8728baeaf722ff0c53c8b8d3b49c53486111 (patch)
tree077650393506345a7a2c767648824f47859c6a2f /clang/test/Misc/ast-dump-templates.cpp
parent9fbc230de22d95bfc624571302c2738c994dd834 (diff)
downloadbcm5719-llvm-d4da8728baeaf722ff0c53c8b8d3b49c53486111.tar.gz
bcm5719-llvm-d4da8728baeaf722ff0c53c8b8d3b49c53486111.zip
Provide operator<< for stream output of DeclarationNames
ASTDumper was already trying to do this & instead got an implicit bool conversion by surprise (thus printing out 0 or 1 instead of the name of the declaration). To avoid that issue & simplify call sites, simply make it the normal/expected operator<<(raw_ostream&, ...) overload & simplify all the existing call sites. (bonus: this function doesn't need to be a member or friend, it's just using public API in DeclarationName) llvm-svn: 181832
Diffstat (limited to 'clang/test/Misc/ast-dump-templates.cpp')
-rw-r--r--clang/test/Misc/ast-dump-templates.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Misc/ast-dump-templates.cpp b/clang/test/Misc/ast-dump-templates.cpp
index 7e28da95a1f..b7aeca8d55d 100644
--- a/clang/test/Misc/ast-dump-templates.cpp
+++ b/clang/test/Misc/ast-dump-templates.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -ast-print %s > %t
// RUN: FileCheck < %t %s -check-prefix=CHECK1
// RUN: FileCheck < %t %s -check-prefix=CHECK2
+// RUN: %clang_cc1 -ast-dump %s | FileCheck --check-prefix=DUMP %s
template <int X, typename Y, int Z = 5>
struct foo {
@@ -37,3 +38,14 @@ void baz() {
// Template definition - bar
// CHECK1: template <int A, typename B> B bar()
// CHECK2: template <int A, typename B> B bar()
+
+namespace test2 {
+void func(int);
+void func(float);
+template<typename T>
+void tmpl() {
+ func(T());
+}
+
+// DUMP: UnresolvedLookupExpr {{.*}} <col:3> '<overloaded function type>' lvalue (ADL) = 'func'
+}
OpenPOWER on IntegriCloud