Improve parser recovery when we try to parse a call expression but the
called function itself is invalid (e.g., because of a semantic error
referring to that declaration). Fixes <rdar://problem/8044142>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105175 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/complete-exprs.c b/test/Index/complete-exprs.c
index 1b55c78..fe30d33 100644
--- a/test/Index/complete-exprs.c
+++ b/test/Index/complete-exprs.c
@@ -7,6 +7,9 @@
   return i | j | k & l;
 }
 
+struct X f1 = { 17 };
+void f2() { f1(17); }
+
 // RUN: c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s
 // CHECK-CC1: macro definition:{TypedText __VERSION__} (70)
 // CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12)
@@ -28,3 +31,7 @@
 // CHECK-CC2: NotImplemented:{TypedText float} (40)
 // CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (8)
 // CHECK-CC2: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
+// RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50)
+// CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50)
+