From cc2f355f71b63f849fbd7cb91b8a09ce27b7b9a1 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Sat, 19 Mar 2016 21:51:45 +0000 Subject: [Sema] Make type deduction work with some overloadable functions Some functions can't have their address taken. If we encounter an overload set where only one of the candidates can have its address taken, we should automatically select that candidate's type in type deduction. Differential Revision: http://reviews.llvm.org/D15591 llvm-svn: 263888 --- clang/lib/Sema/SemaTemplateDeduction.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index b101a16f5c8..aa824c37fe1 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -3016,6 +3016,11 @@ ResolveOverloadForDeduction(Sema &S, TemplateParameterList *TemplateParams, return GetTypeOfFunction(S, R, ExplicitSpec); } + DeclAccessPair DAP; + if (FunctionDecl *Viable = + S.resolveAddressOfOnlyViableOverloadCandidate(Arg, DAP)) + return GetTypeOfFunction(S, R, Viable); + return QualType(); } -- cgit v1.2.3