Tweak the new ResolveOverloadedCallFn to just return a FunctionDecl. It makes ActOnCallExpr simpler

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60094 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index a6e1611..a13bcba 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1295,12 +1295,16 @@
   }
 
   if (Ovl) {
-    Fn = ResolveOverloadedCallFn(Fn, Ovl, LParenLoc, Args, NumArgs, CommaLocs,
-                                 RParenLoc);
-    if (!Fn)
+    FDecl = ResolveOverloadedCallFn(Fn, Ovl, LParenLoc, Args, NumArgs, CommaLocs,
+                                    RParenLoc);
+    if (!FDecl)
       return true;
 
-    // Fall through and build the call to Fn.
+    // Update Fn to refer to the actual function selected.
+    Expr *NewFn = new DeclRefExpr(FDecl, FDecl->getType(), 
+                                  Fn->getSourceRange().getBegin());
+    Fn->Destroy(Context);
+    Fn = NewFn;
   }
 
   if (getLangOptions().CPlusPlus && Fn->getType()->isRecordType())