diff options
author | John McCall <rjmccall@apple.com> | 2010-01-26 06:04:06 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-01-26 06:04:06 +0000 |
commit | a113e7263c5337731c65fada9de7ff72af25423b (patch) | |
tree | 523d7fdb7af84813eb0923dc3c7b22e1a65fb244 /lib/Sema/SemaLookup.cpp | |
parent | dbdad6d9330603ab1c11bf9f2a9ea294b56babf6 (diff) |
Allow ADL to find functions imported by using decls. Leave wordy comment
about interaction between ADL and default arguments. Shrug shoulders, commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 5b03fa48c3..c61d666c4b 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1785,16 +1785,20 @@ void Sema::ArgumentDependentLookup(DeclarationName Name, bool Operator, continue; } - // FIXME: using decls? canonical decls? - - FunctionDecl *Fn; - if (!Operator || !(Fn = dyn_cast<FunctionDecl>(D)) || - IsAcceptableNonMemberOperatorCandidate(Fn, T1, T2, Context)) { - if (isa<FunctionDecl>(D)) - Functions.insert(D); - else if (isa<FunctionTemplateDecl>(D)) - Functions.insert(D); - } + if (isa<UsingShadowDecl>(D)) + D = cast<UsingShadowDecl>(D)->getTargetDecl(); + + // FIXME: canonical decls. + // See comment in AddArgumentDependentLookupCandidates(). + + if (isa<FunctionDecl>(D)) { + if (Operator && + !IsAcceptableNonMemberOperatorCandidate(cast<FunctionDecl>(D), + T1, T2, Context)) + continue; + Functions.insert(D); + } else if (isa<FunctionTemplateDecl>(D)) + Functions.insert(D); } } } |