From adc7a739301d123914b7124e749b7ec74fa91397 Mon Sep 17 00:00:00 2001 From: Kaelyn Uhrain Date: Mon, 8 Aug 2011 17:35:31 +0000 Subject: [PATCH] Make sure FunctionDecls aren't considered during overload resolution if there are explicit template args. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137054 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExpr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 5e092b7c06..2814004b0b 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1457,14 +1457,15 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R, for (TypoCorrection::decl_iterator CD = Corrected.begin(), CDEnd = Corrected.end(); CD != CDEnd; ++CD) { - if (FunctionDecl *FD = dyn_cast(*CD)) - AddOverloadCandidate(FD, DeclAccessPair::make(FD, AS_none), - Args, NumArgs, OCS); - else if (FunctionTemplateDecl *FTD = + if (FunctionTemplateDecl *FTD = dyn_cast(*CD)) AddTemplateOverloadCandidate( FTD, DeclAccessPair::make(FTD, AS_none), ExplicitTemplateArgs, Args, NumArgs, OCS); + else if (FunctionDecl *FD = dyn_cast(*CD)) + if (!ExplicitTemplateArgs || ExplicitTemplateArgs->size() == 0) + AddOverloadCandidate(FD, DeclAccessPair::make(FD, AS_none), + Args, NumArgs, OCS); } switch (OCS.BestViableFunction(*this, R.getNameLoc(), Best)) { case OR_Success: -- 2.40.0