[cfe-commits] r137054 - /cfe/trunk/lib/Sema/SemaExpr.cpp
Kaelyn Uhrain
rikka at google.com
Mon Aug 8 10:35:31 PDT 2011
Author: rikka
Date: Mon Aug 8 12:35:31 2011
New Revision: 137054
URL: http://llvm.org/viewvc/llvm-project?rev=137054&view=rev
Log:
Make sure FunctionDecls aren't considered during overload resolution if there
are explicit template args.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=137054&r1=137053&r2=137054&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Aug 8 12:35:31 2011
@@ -1457,14 +1457,15 @@
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:
More information about the cfe-commits
mailing list