diff options
Diffstat (limited to 'test/SemaTemplate/dependent-names.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-names.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-names.cpp b/test/SemaTemplate/dependent-names.cpp index f778bd9d2c..7bab5d18d1 100644 --- a/test/SemaTemplate/dependent-names.cpp +++ b/test/SemaTemplate/dependent-names.cpp @@ -262,3 +262,33 @@ namespace PR10053 { } } } + +namespace PR10187 { + namespace A { + template<typename T> + struct S { + void f() { + for (auto &a : e) + __range(a); // expected-error {{undeclared identifier '__range'}} + } + int e[10]; + }; + void g() { + S<int>().f(); // expected-note {{here}} + } + } + + namespace B { + template<typename T> void g(); // expected-note {{not viable}} + template<typename T> void f() { + g<int>(T()); // expected-error {{no matching function}} + } + + namespace { + struct S {}; + } + void g(S); + + template void f<S>(); // expected-note {{here}} + } +} |