summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/dependent-names.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-22 02:46:14 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-22 02:46:14 +0000
commit21bae43fab8fac10a94ceb8d75d9c06eb4d921fe (patch)
tree8044eca44322547babd27ac525ed1a86aafba6ca /clang/test/SemaTemplate/dependent-names.cpp
parent6200471a70d5c7ac3c0e2ca51fefe40bab653142 (diff)
downloadbcm5719-llvm-21bae43fab8fac10a94ceb8d75d9c06eb4d921fe.tar.gz
bcm5719-llvm-21bae43fab8fac10a94ceb8d75d9c06eb4d921fe.zip
PR14695: Fix assert from bad cast<>. Not every namespace is a NamespaceDecl; it might instead be a TranslationUnitDecl.
llvm-svn: 170976
Diffstat (limited to 'clang/test/SemaTemplate/dependent-names.cpp')
-rw-r--r--clang/test/SemaTemplate/dependent-names.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-names.cpp b/clang/test/SemaTemplate/dependent-names.cpp
index 7ef12b8788b..eb75e69ef4d 100644
--- a/clang/test/SemaTemplate/dependent-names.cpp
+++ b/clang/test/SemaTemplate/dependent-names.cpp
@@ -360,3 +360,12 @@ namespace test_reserved_identifiers {
tempf(x, y); // expected-note{{in instantiation of}}
}
}
+
+// This test must live in the global namespace.
+struct PR14695_X {};
+// FIXME: This note is bogus; it is the using directive which would need to move
+// to prior to the call site to fix the problem.
+namespace PR14695_A { void PR14695_f(PR14695_X); } // expected-note {{'PR14695_f' should be declared prior to the call site or in the global namespace}}
+template<typename T> void PR14695_g(T t) { PR14695_f(t); } // expected-error {{call to function 'PR14695_f' that is neither visible in the template definition nor found by argument-dependent lookup}}
+using namespace PR14695_A;
+template void PR14695_g(PR14695_X); // expected-note{{requested here}}
OpenPOWER on IntegriCloud