aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-template-decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-06-17 23:37:01 +0000
committerDouglas Gregor <dgregor@apple.com>2009-06-17 23:37:01 +0000
commitc19ee3eb08ce1d77504d5fc27f7c44b94543221b (patch)
tree0f052fcc1c2f2c1deab4d2ff4e82defa883ccad9 /test/Parser/cxx-template-decl.cpp
parent6a6170ca75f1b5a1c768803462ccd27b58b4d196 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-template-decl.cpp')
-rw-r--r--test/Parser/cxx-template-decl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp
index ae5d8f9e0c..75b26a98e4 100644
--- a/test/Parser/cxx-template-decl.cpp
+++ b/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) {