Implement -Wshadow for parameter declarations as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99037 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/warn-shadow.c b/test/Sema/warn-shadow.c
index dacf66d..c9a783b 100644
--- a/test/Sema/warn-shadow.c
+++ b/test/Sema/warn-shadow.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -verify -fsyntax-only -Wshadow %s
+// RUN: %clang_cc1 -verify -fsyntax-only -fblocks -Wshadow %s
 
-int i;          // expected-note {{previous declaration is here}}
+int i;          // expected-note 3 {{previous declaration is here}}
 
 void foo() {
   int pass1;
@@ -18,3 +18,28 @@
 
   int sin; // okay; 'sin' has not been declared, even though it's a builtin.
 }
+
+// <rdar://problem/7677531>
+void (^test1)(int) = ^(int i) { // expected-warning {{declaration shadows a variable in the global scope}} \
+                                 // expected-note{{previous declaration is here}}
+  {
+    int i; // expected-warning {{declaration shadows a local variable}} \
+           // expected-note{{previous declaration is here}}
+    
+    (^(int i) { return i; })(i); //expected-warning {{declaration shadows a local variable}}
+  }
+};
+
+
+struct test2 {
+  int i;
+};
+
+void test3(void) {
+  struct test4 {
+    int i;
+  };
+}
+
+void test4(int i) { // expected-warning {{declaration shadows a variable in the global scope}}
+}