Handle any undeclared parameters in a K&R-style function with a
special action, inside function prototype scope. This avoids confusion
when we try to inject these parameters into the scope of the function
body before the function itself has been added to the surrounding
scope. Fixes <rdar://problem/6097326>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62849 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/function.c b/test/Sema/function.c
index de970a0..677f6a3 100644
--- a/test/Sema/function.c
+++ b/test/Sema/function.c
@@ -39,3 +39,7 @@
 int t14() {
   return; // expected-warning {{non-void function 't14' should return a value}}
 }
+
+// <rdar://problem/6097326>
+y(y) { return y; } // expected-warning{{parameter 'y' was not declared, defaulting to type 'int'}} \
+                   // expected-warning{{type specifier missing, defaults to 'int'}}