diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-17 23:37:01 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-17 23:37:01 +0000 |
commit | f187420feb5429f97533cac1e160d08c2b9cb47a (patch) | |
tree | d78bf394ad70392fdad746ab08f7b37c2a3e85ea /clang/test/Parser/cxx-template-decl.cpp | |
parent | 4dd5b57ef43f17a65abe7e8c246bf30f96648e0c (diff) | |
download | bcm5719-llvm-f187420feb5429f97533cac1e160d08c2b9cb47a.tar.gz bcm5719-llvm-f187420feb5429f97533cac1e160d08c2b9cb47a.zip |
Diagnose class members that shadow a template parameter. Fixes
<rdar://problem/6952203>.
To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.
llvm-svn: 73659
Diffstat (limited to 'clang/test/Parser/cxx-template-decl.cpp')
-rw-r--r-- | clang/test/Parser/cxx-template-decl.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-template-decl.cpp b/clang/test/Parser/cxx-template-decl.cpp index ae5d8f9e0cc..75b26a98e44 100644 --- a/clang/test/Parser/cxx-template-decl.cpp +++ b/clang/test/Parser/cxx-template-decl.cpp @@ -66,6 +66,17 @@ class T { // expected-error{{declaration of 'T' shadows template parameter}} template<int Size> // expected-note{{template parameter is declared here}} void shadow3(int Size); // expected-error{{declaration of 'Size' shadows template parameter}} +// <rdar://problem/6952203> +template<typename T> // expected-note{{here}} +struct shadow4 { + int T; // expected-error{{shadows}} +}; + +template<typename T> // expected-note{{here}} +struct shadow5 { + int T(int, float); // expected-error{{shadows}} +}; + // Non-type template parameters in scope template<int Size> void f(int& i) { |