Basic support for taking the address of an overloaded function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59000 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 41ee8dd..a6a62a9 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -280,7 +280,16 @@
break;
case ICK_Array_To_Pointer:
- FromType = Context.getArrayDecayedType(FromType);
+ if (FromType->isOverloadType()) {
+ FunctionDecl *Fn = ResolveAddressOfOverloadedFunction(From, ToType, true);
+ if (!Fn)
+ return true;
+
+ FixOverloadedFunctionReference(From, Fn);
+ FromType = From->getType();
+ } else {
+ FromType = Context.getArrayDecayedType(FromType);
+ }
ImpCastExprToType(From, FromType);
break;