diff options
author | John McCall <rjmccall@apple.com> | 2009-11-17 05:59:44 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-11-17 05:59:44 +0000 |
commit | 9488ea120e093068021f944176c3d610dd540914 (patch) | |
tree | b25280b1967cb1edee70e5f7faceee121a9d897a /lib/AST/Decl.cpp | |
parent | 049d3a06ea9f8fc03582488a2b7f24512565a335 (diff) |
Instead of hanging a using declaration's target decls directly off the using
decl, create shadow declarations and put them in scope like normal.
Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index a6996a4bfe..bdc804722c 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -289,6 +289,10 @@ bool NamedDecl::declarationReplaces(NamedDecl *OldD) const { if (isa<ObjCInterfaceDecl>(this) && isa<ObjCCompatibleAliasDecl>(OldD)) return true; + if (isa<UsingShadowDecl>(this) && isa<UsingShadowDecl>(OldD)) + return cast<UsingShadowDecl>(this)->getTargetDecl() == + cast<UsingShadowDecl>(OldD)->getTargetDecl(); + // For non-function declarations, if the declarations are of the // same kind then this must be a redeclaration, or semantic analysis // would not have given us the new declaration. @@ -308,7 +312,7 @@ bool NamedDecl::hasLinkage() const { NamedDecl *NamedDecl::getUnderlyingDecl() { NamedDecl *ND = this; while (true) { - if (UsingDecl *UD = dyn_cast<UsingDecl>(ND)) + if (UsingShadowDecl *UD = dyn_cast<UsingShadowDecl>(ND)) ND = UD->getTargetDecl(); else if (ObjCCompatibleAliasDecl *AD = dyn_cast<ObjCCompatibleAliasDecl>(ND)) |