diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-21 14:40:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-21 14:40:46 +0000 |
commit | 7c26c04ba95cae2c7b0ecab2fb7cf5f2f381985b (patch) | |
tree | ab6f05cd90f7b15549c296c5948f26937faa460a /clang/test/SemaTemplate/nested-template.cpp | |
parent | bc9ba301580f24cbddd312f9d715e29d80ff7673 (diff) | |
download | bcm5719-llvm-7c26c04ba95cae2c7b0ecab2fb7cf5f2f381985b.tar.gz bcm5719-llvm-7c26c04ba95cae2c7b0ecab2fb7cf5f2f381985b.zip |
Diagnose attempts to write a templated data member, from Stepan
Dyatkovskiy! Fixes PR10896.
llvm-svn: 140250
Diffstat (limited to 'clang/test/SemaTemplate/nested-template.cpp')
-rw-r--r-- | clang/test/SemaTemplate/nested-template.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/nested-template.cpp b/clang/test/SemaTemplate/nested-template.cpp index 01ede32f9a0..ab647aa2267 100644 --- a/clang/test/SemaTemplate/nested-template.cpp +++ b/clang/test/SemaTemplate/nested-template.cpp @@ -125,4 +125,20 @@ X2<int>::Inner<X2_arg> x2i1; X2<float> x2a; // expected-note{{instantiation}} X2<long>::Inner<X2_arg> x2i3; // expected-error{{template template argument has different}} +namespace PR10896 { + template<typename TN> + class Foo { + + public: + void foo() {} + private: + + template<typename T> + T SomeField; // expected-error {{member 'SomeField' declared as a template}} + }; + void g() { + Foo<int> f; + f.foo(); + } +} |