===================================================================
@@ -9394,6 +9394,9 @@ store_parm_decls_oldstyle (tree fndecl, const stru
"old-style function definition");
}
+ if (current_scope->had_vla_unspec)
+ error ("%<[*]%> not allowed in other than function prototype scope");
+
/* Match each formal parameter name with its declaration. Save each
decl in the appropriate TREE_PURPOSE slot of the parmids chain. */
for (parm = parmids; parm; parm = TREE_CHAIN (parm))
===================================================================
@@ -0,0 +1,9 @@
+/* Test [*] diagnosed on old-style parameter declaration. PR c/88704. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+void
+f (x)
+ int x[*];
+{ /* { dg-error "not allowed in other than function prototype scope" } */
+}