Fix crash declaring global allocation function with zero parameters. Fixes PR19968!

llvm-svn: 210388
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 89470725..7234d4c 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -2348,7 +2348,7 @@
     return false;
 
   const FunctionProtoType *FPT = getType()->castAs<FunctionProtoType>();
-  if (FPT->getNumParams() > 2 || FPT->isVariadic())
+  if (FPT->getNumParams() == 0 || FPT->getNumParams() > 2 || FPT->isVariadic())
     return false;
 
   // If this is a single-parameter function, it must be a replaceable global