diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-28 21:15:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-28 21:15:08 +0000 |
commit | 5c58093178b3547ddf5d041e54d6ecc606e812b0 (patch) | |
tree | 5b2b710c89dfb04238987db52123a5478f246b21 | |
parent | d99bb43068b1c5f8db44f1a114e72bbc2e71ae54 (diff) | |
download | bcm5719-llvm-5c58093178b3547ddf5d041e54d6ecc606e812b0.tar.gz bcm5719-llvm-5c58093178b3547ddf5d041e54d6ecc606e812b0.zip |
Test instantiations of out-of-line member definitions of nested templates.
llvm-svn: 80395
-rw-r--r-- | clang/test/SemaTemplate/instantiate-member-template.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-member-template.cpp b/clang/test/SemaTemplate/instantiate-member-template.cpp index d72028df8a5..ebc3a5293f2 100644 --- a/clang/test/SemaTemplate/instantiate-member-template.cpp +++ b/clang/test/SemaTemplate/instantiate-member-template.cpp @@ -54,8 +54,24 @@ struct X1 { } }; + template<typename U> + struct Inner4; +}; + +template<typename T> +template<typename U> +struct X1<T>::Inner4 { + template<typename V> + V f2(T t, U u, V); }; +template<typename T> +template<typename U> +template<typename V> +V X1<T>::Inner4<U>::f2(T t, U u, V) { + return t + u; // expected-error{{incompatible type}} +} + void test_X1(int *ip, int i, double *dp) { X1<void>::Inner0<int> *xvip; // okay X1<void>::Inner0<int> xvi; // expected-note{{instantiation}} @@ -74,4 +90,7 @@ void test_X1(int *ip, int i, double *dp) { X1<int*>::Inner3<double*> id3b; id3b.f0(ip, dp); // expected-note{{instantiation}} + + X1<int*>::Inner4<int> id4; + id4.f2(ip, i, dp); // expected-note{{instantiation}} } |