diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-26 22:19:54 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-26 22:19:54 +0000 |
commit | 2ced044c34311d8e6301f2b4566f4b612bc8b628 (patch) | |
tree | d04b42f4b30e9158b31e2acfc6693a7149d821bf /test/SemaTemplate/dependent-names.cpp | |
parent | 6594942e98e25640f226aba622eb76bcaf0a521c (diff) |
Fix PR10187: when diagnosing a two-phase-lookup-related failure, don't assert that any names we find are valid candidates for the call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133898 91177308-0d34-0410-b5e6-96231b3b80d8
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}} + } +} |