aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2011-08-08 17:35:31 +0000
committerKaelyn Uhrain <rikka@google.com>2011-08-08 17:35:31 +0000
commitadc7a739301d123914b7124e749b7ec74fa91397 (patch)
tree91e8639bd9f08fa69ea4b04c93d29f61d80d9bb7
parent7ca13ef64136929df852c038ebbddee070dc5119 (diff)
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
-rw-r--r--lib/Sema/SemaExpr.cpp9
1 files 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<FunctionDecl>(*CD))
- AddOverloadCandidate(FD, DeclAccessPair::make(FD, AS_none),
- Args, NumArgs, OCS);
- else if (FunctionTemplateDecl *FTD =
+ if (FunctionTemplateDecl *FTD =
dyn_cast<FunctionTemplateDecl>(*CD))
AddTemplateOverloadCandidate(
FTD, DeclAccessPair::make(FTD, AS_none), ExplicitTemplateArgs,
Args, NumArgs, OCS);
+ else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(*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: