diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-26 05:26:50 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-26 05:26:50 +0000 |
commit | 58badb7a655d021fc67bb7ed0af95d6ea0c63eb1 (patch) | |
tree | 3a735ecc37d697ee049c566eab90c016103876e0 /lib/Sema/SemaLookup.cpp | |
parent | 5e50569d45d7c8545fecd17685a3a613b1cb0158 (diff) |
See through UsingDecls in more places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74269 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index e1c6302fcc..d76761c696 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -139,16 +139,24 @@ MaybeConstructOverloadSet(ASTContext &Context, // nothing to leak. Ovl = OverloadedFunctionDecl::Create(Context, (*I)->getDeclContext(), (*I)->getDeclName()); - if (isa<FunctionDecl>(*I)) - Ovl->addOverload(cast<FunctionDecl>(*I)); + NamedDecl *ND = (*I); + if (UsingDecl *UD = dyn_cast<UsingDecl>(ND)) + ND = UD->getTargetDecl(); + + if (isa<FunctionDecl>(ND)) + Ovl->addOverload(cast<FunctionDecl>(ND)); else - Ovl->addOverload(cast<FunctionTemplateDecl>(*I)); + Ovl->addOverload(cast<FunctionTemplateDecl>(ND)); } - if (isa<FunctionDecl>(*Last)) - Ovl->addOverload(cast<FunctionDecl>(*Last)); + NamedDecl *ND = (*Last); + if (UsingDecl *UD = dyn_cast<UsingDecl>(ND)) + ND = UD->getTargetDecl(); + + if (isa<FunctionDecl>(ND)) + Ovl->addOverload(cast<FunctionDecl>(ND)); else - Ovl->addOverload(cast<FunctionTemplateDecl>(*Last)); + Ovl->addOverload(cast<FunctionTemplateDecl>(ND)); } // If we had more than one function, we built an overload |