From: Kaelyn Uhrain Date: Mon, 8 Aug 2011 17:35:31 +0000 (+0000) Subject: Make sure FunctionDecls aren't considered during overload resolution if there X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=adc7a739301d123914b7124e749b7ec74fa91397;p=clang 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 --- 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: