diff options
Diffstat (limited to 'test/SemaTemplate/nested-name-spec-template.cpp')
-rw-r--r-- | test/SemaTemplate/nested-name-spec-template.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/SemaTemplate/nested-name-spec-template.cpp b/test/SemaTemplate/nested-name-spec-template.cpp index 9c72845..635687d 100644 --- a/test/SemaTemplate/nested-name-spec-template.cpp +++ b/test/SemaTemplate/nested-name-spec-template.cpp @@ -99,3 +99,44 @@ namespace PR7725 { } }; } + +namespace PR9226 { + template<typename a> + void nt() // expected-note{{function template 'nt' declared here}} + { nt<>:: } // expected-error{{qualified name refers into a specialization of function template 'nt'}} \ + // expected-error{{expected unqualified-id}} + + template<typename T> + void f(T*); // expected-note{{function template 'f' declared here}} + + template<typename T> + void f(T*, T*); // expected-note{{function template 'f' declared here}} + + void g() { + f<int>:: // expected-error{{qualified name refers into a specialization of function template 'f'}} + } // expected-error{{expected unqualified-id}} + + struct X { + template<typename T> void f(); // expected-note{{function template 'f' declared here}} + }; + + template<typename T, typename U> + struct Y { + typedef typename T::template f<U> type; // expected-error{{template name refers to non-type template 'X::f'}} + }; + + Y<X, int> yxi; // expected-note{{in instantiation of template class 'PR9226::Y<PR9226::X, int>' requested here}} +} + +namespace PR9449 { + template <typename T> + struct s; // expected-note{{template is declared here}} + + template <typename T> + void f() { + int s<T>::template n<T>::* f; // expected-error{{implicit instantiation of undefined template 'PR9449::s<int>'}} \ + // expected-error{{following the 'template' keyword}} + } + + template void f<int>(); // expected-note{{in instantiation of}} +} |