Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td	(revision 94967)
+++ include/clang/Basic/DiagnosticSemaKinds.td	(working copy)
@@ -85,6 +85,8 @@ def warn_unused_variable : Warning<"unus
   InGroup<UnusedVariable>, DefaultIgnore;
 def warn_decl_in_param_list : Warning<
   "declaration of %0 will not be visible outside of this function">;
+def err_array_star_in_function_definition : Error<
+  "variable length array must be bound in function definition">;
 
 def warn_implicit_function_decl : Warning<
   "implicit declaration of function %0">,
Index: lib/Sema/SemaChecking.cpp
===================================================================
--- lib/Sema/SemaChecking.cpp	(revision 94967)
+++ lib/Sema/SemaChecking.cpp	(working copy)
@@ -2616,6 +2616,13 @@ bool Sema::CheckParmsForFunctionDef(Func
         !Param->isImplicit() &&
         !getLangOptions().CPlusPlus)
       Diag(Param->getLocation(), diag::err_parameter_name_omitted);
+  
+    QualType PType = Param->getOriginalType();
+    if (const ArrayType *AT = Context.getAsArrayType(PType)) {
+      if (AT->getSizeModifier() == ArrayType::Star) {
+        Diag(Param->getLocation(), diag::err_array_star_in_function_definition);
+      }
+    }
   }
 
   return HasInvalidParm;
Index: test/Sema/vla.c
===================================================================
--- test/Sema/vla.c	(revision 94967)
+++ test/Sema/vla.c	(working copy)
@@ -54,3 +54,9 @@ int (*pr2044c(void))[pr2044b]; // expect
 
 const int f5_ci = 1;
 void f5() { char a[][f5_ci] = {""}; } // expected-error {{variable-sized object may not be initialized}}
+
+// PR5185
+void pr5185(int a[*]);
+void pr5185(int a[*]) // expected-error {{variable length array must be bound in function definition}}
+{
+}
