Change FixOverloadedFunctionReference to return a (possibly new) expression. Substitute TemplateIdRefExprs with DeclRefExprs. Doug, plz review :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84763 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 181c134..5671112 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1226,12 +1226,13 @@
       if (DiagnoseUseOfDecl(Fn, From->getSourceRange().getBegin()))
         return true;
 
-      bool WasAddrOf = FixOverloadedFunctionReference(From, Fn);
+      From = FixOverloadedFunctionReference(From, Fn);
       FromType = From->getType();
+        
       // If there's already an address-of operator in the expression, we have
       // the right type already, and the code below would just introduce an
       // invalid additional pointer level.
-      if (WasAddrOf)
+      if (FromType->isPointerType() || FromType->isMemberFunctionPointerType())
         break;
     }
     FromType = Context.getPointerType(FromType);