Make sure that all NamedDecls have an identifier namespace.
Make sure that we know a call is invalid if we dropped arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62882 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 6ec4d4a..202f07b 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1684,7 +1684,8 @@
   // assignment, to the types of the corresponding parameter, ...
   unsigned NumArgsInProto = Proto->getNumArgs();
   unsigned NumArgsToCheck = NumArgs;
-  
+  bool Invalid = false;
+
   // If too few arguments are available (and we don't have default
   // arguments for the remaining parameters), don't make the call.
   if (NumArgs < NumArgsInProto) {
@@ -1707,6 +1708,7 @@
                        Args[NumArgs-1]->getLocEnd());
       // This deletes the extra arguments.
       Call->setNumArgs(NumArgsInProto);
+      Invalid = true;
     }
     NumArgsToCheck = NumArgsInProto;
   }
@@ -1746,7 +1748,7 @@
     }
   }
 
-  return false;
+  return Invalid;
 }
 
 /// ActOnCallExpr - Handle a call to Fn with the specified array of arguments.