diff options
author | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /test/SemaTemplate/typename-specifier.cpp | |
parent | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff) | |
download | FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz |
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'test/SemaTemplate/typename-specifier.cpp')
-rw-r--r-- | test/SemaTemplate/typename-specifier.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/SemaTemplate/typename-specifier.cpp b/test/SemaTemplate/typename-specifier.cpp index 4c788f6..7898a20 100644 --- a/test/SemaTemplate/typename-specifier.cpp +++ b/test/SemaTemplate/typename-specifier.cpp @@ -71,3 +71,34 @@ struct C { ::Y<A>::type ip7 = &i; ::Y<B>::type ip8 = &i; // expected-note{{in instantiation of template class 'Y<B>' requested here}} ::Y<C>::type ip9 = &i; // expected-note{{in instantiation of template class 'Y<C>' requested here}} + +template<typename T> struct D { + typedef typename T::foo foo; // expected-error {{type 'long' cannot be used prior to '::' because it has no members}} + typedef typename foo::bar bar; +}; + +D<long> struct_D; // expected-note {{in instantiation of template class 'D<long>' requested here}} + +template<typename T> struct E { + typedef typename T::foo foo; + typedef typename foo::bar bar; // expected-error {{type 'foo' (aka 'double') cannot be used prior to '::' because it has no members}} +}; + +struct F { + typedef double foo; +}; + +E<F> struct_E; // expected-note {{in instantiation of template class 'E<F>' requested here}} + +template<typename T> struct G { + typedef typename T::foo foo; + typedef typename foo::bar bar; +}; + +struct H { + struct foo { + typedef double bar; + }; +}; + +G<H> struct_G; |