Add CheckCallReturnType and start using it for regular call expressions. This will improve error messages. For 

struct B;

B f();

void g() {
f();
}

We now get

t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B'
  f();
  ^~~
t.cpp:3:3: note: 'f' declared here
B f();
  ^
t.cpp:1:8: note: forward declaration of 'struct B'
struct B;
       ^

llvm-svn: 83692
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 33d7468..6c9466f 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -493,7 +493,10 @@
   virtual TypeResult ActOnTypeName(Scope *S, Declarator &D);
 
   bool RequireCompleteType(SourceLocation Loc, QualType T,
-                           const PartialDiagnostic &PD);
+                           const PartialDiagnostic &PD,
+                           std::pair<SourceLocation,
+                                     PartialDiagnostic> Note =
+                            std::make_pair(SourceLocation(), PDiag()));
 
   QualType getQualifiedNameType(const CXXScopeSpec &SS, QualType T);
 
@@ -959,6 +962,12 @@
   OwningExprResult BuildOverloadedArrowExpr(Scope *S, ExprArg Base,
                                             SourceLocation OpLoc);
 
+  /// CheckCallReturnType - Checks that a call expression's return type is
+  /// complete. Returns true on failure. The location passed in is the location
+  /// that best represents the call.
+  bool CheckCallReturnType(QualType ReturnType, SourceLocation Loc,
+                           CallExpr *CE, FunctionDecl *FD);
+                           
   /// Helpers for dealing with blocks and functions.
   void CheckFallThroughForFunctionDef(Decl *D, Stmt *Body);
   void CheckFallThroughForBlock(QualType BlockTy, Stmt *Body);