diff options
author | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
commit | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (patch) | |
tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/SemaTemplate/nested-name-spec-template.cpp | |
parent | a0fb00f9837bd0d2e5948f16f6a6b82a7a628f51 (diff) | |
download | FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.zip FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.tar.gz |
Vendor import of clang trunk r130700:
http://llvm.org/svn/llvm-project/cfe/trunk@130700
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}} +} |