Shift things around so that it's easier to recover from a missing
function in a C++ call using an arbitrary call-expression type.
Actually exploit this to fix the recovery implemented earlier.

The diagnostic is still iffy, though.

llvm-svn: 91538
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index f189790..a756bb4 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -58,6 +58,7 @@
   class DesignatedInitExpr;
   class CallExpr;
   class DeclRefExpr;
+  class UnresolvedLookupExpr;
   class VarDecl;
   class ParmVarDecl;
   class TypedefDecl;
@@ -1038,23 +1039,17 @@
   OwningExprResult FixOverloadedFunctionReference(OwningExprResult, 
                                                   FunctionDecl *Fn);
 
-  void AddOverloadedCallCandidates(llvm::SmallVectorImpl<NamedDecl*>& Callees,
-                                   DeclarationName &UnqualifiedName,
-                                   bool ArgumentDependentLookup,
-                         const TemplateArgumentListInfo *ExplicitTemplateArgs,
+  void AddOverloadedCallCandidates(UnresolvedLookupExpr *ULE,
                                    Expr **Args, unsigned NumArgs,
                                    OverloadCandidateSet &CandidateSet,
                                    bool PartialOverloading = false);
     
-  FunctionDecl *ResolveOverloadedCallFn(Expr *Fn,
-                                        llvm::SmallVectorImpl<NamedDecl*> &Fns,
-                                        DeclarationName UnqualifiedName,
-                          const TemplateArgumentListInfo *ExplicitTemplateArgs,
-                                        SourceLocation LParenLoc,
-                                        Expr **Args, unsigned NumArgs,
-                                        SourceLocation *CommaLocs,
-                                        SourceLocation RParenLoc,
-                                        bool ArgumentDependentLookup);
+  OwningExprResult BuildOverloadedCallExpr(Expr *Fn,
+                                           UnresolvedLookupExpr *Fn,
+                                           SourceLocation LParenLoc,
+                                           Expr **Args, unsigned NumArgs,
+                                           SourceLocation *CommaLocs,
+                                           SourceLocation RParenLoc);
 
   OwningExprResult CreateOverloadedUnaryOp(SourceLocation OpLoc,
                                            unsigned Opc,
@@ -1501,6 +1496,9 @@
                                            FieldDecl *Field,
                                            Expr *BaseObjectExpr = 0,
                                       SourceLocation OpLoc = SourceLocation());
+  OwningExprResult BuildPossibleImplicitMemberExpr(const CXXScopeSpec &SS,
+                                                   LookupResult &R,
+                                const TemplateArgumentListInfo *TemplateArgs);
   OwningExprResult BuildImplicitMemberExpr(const CXXScopeSpec &SS,
                                            LookupResult &R,
                                 const TemplateArgumentListInfo *TemplateArgs,
@@ -1627,16 +1625,6 @@
                                Expr **Args, unsigned NumArgs,
                                SourceLocation RParenLoc);
 
-  void DeconstructCallFunction(Expr *FnExpr,
-                               llvm::SmallVectorImpl<NamedDecl*>& Fns,
-                               DeclarationName &Name,
-                               NestedNameSpecifier *&Qualifier,
-                               SourceRange &QualifierRange,
-                               bool &ArgumentDependentLookup,
-                               bool &Overloaded,
-                               bool &HasExplicitTemplateArgs,
-                               TemplateArgumentListInfo &ExplicitTemplateArgs);
-    
   /// ActOnCallExpr - Handle a call to Fn with the specified array of arguments.
   /// This provides the location of the left/right parens and a list of comma
   /// locations.