summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-10-23 19:23:15 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-10-23 19:23:15 +0000
commitc057f423a079bf67942cd1e4b3c29953bbd48703 (patch)
treeb19e5e959b3eb67d9c06c048272ffe9fd8bb48a1 /clang/lib/Sema/SemaLookup.cpp
parent4bd90e53c292b73d51301600bd8eada862693dfc (diff)
downloadbcm5719-llvm-c057f423a079bf67942cd1e4b3c29953bbd48703.tar.gz
bcm5719-llvm-c057f423a079bf67942cd1e4b3c29953bbd48703.zip
Apply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent lookup too. This fixes PR5244.
llvm-svn: 84963
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index dd877c16fba..abed5d4d170 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -1561,7 +1561,7 @@ static void CollectFunctionDecl(Sema::FunctionSet &Functions,
Functions.insert(FunTmpl);
}
-void Sema::ArgumentDependentLookup(DeclarationName Name,
+void Sema::ArgumentDependentLookup(DeclarationName Name, bool Operator,
Expr **Args, unsigned NumArgs,
FunctionSet &Functions) {
// Find all of the associated namespaces and classes based on the
@@ -1572,6 +1572,13 @@ void Sema::ArgumentDependentLookup(DeclarationName Name,
AssociatedNamespaces,
AssociatedClasses);
+ QualType T1, T2;
+ if (Operator) {
+ T1 = Args[0]->getType();
+ if (NumArgs >= 2)
+ T2 = Args[1]->getType();
+ }
+
// C++ [basic.lookup.argdep]p3:
// Let X be the lookup set produced by unqualified lookup (3.4.1)
// and let Y be the lookup set produced by argument dependent
@@ -1608,7 +1615,10 @@ void Sema::ArgumentDependentLookup(DeclarationName Name,
continue;
}
- CollectFunctionDecl(Functions, D);
+ FunctionDecl *Fn;
+ if (!Operator || !(Fn = dyn_cast<FunctionDecl>(D)) ||
+ IsAcceptableNonMemberOperatorCandidate(Fn, T1, T2, Context))
+ CollectFunctionDecl(Functions, D);
}
}
}
OpenPOWER on IntegriCloud