diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-26 03:37:05 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-26 03:37:05 +0000 |
commit | 8b50d01949c649fbe89ea83f76e5f445170c7d26 (patch) | |
tree | 4862afa509f65549e5313d581d65c7fb6480284f /lib/Sema/SemaLookup.cpp | |
parent | 87471f5b64783c52e01e7accc1b123560b52bf35 (diff) |
When creating LookupResults, see through UsingDecls. Fixes PR4450.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index e6f3d9ec3b..4d25f5b480 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -325,7 +325,9 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context, NamedDecl *D) { if (ObjCCompatibleAliasDecl *Alias = dyn_cast_or_null<ObjCCompatibleAliasDecl>(D)) D = Alias->getClassInterface(); - + if (UsingDecl *UD = dyn_cast_or_null<UsingDecl>(D)) + D = UD->getTargetDecl(); + LookupResult Result; Result.StoredKind = (D && isa<OverloadedFunctionDecl>(D))? OverloadedDeclSingleDecl : SingleDecl; @@ -358,7 +360,9 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context, if (ObjCCompatibleAliasDecl *Alias = dyn_cast_or_null<ObjCCompatibleAliasDecl>(D)) D = Alias->getClassInterface(); - + if (UsingDecl *UD = dyn_cast_or_null<UsingDecl>(D)) + D = UD->getTargetDecl(); + Result.StoredKind = SingleDecl; Result.First = reinterpret_cast<uintptr_t>(D); Result.Last = 0; |