diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-18 14:59:57 +0000 |
| commit | b3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (patch) | |
| tree | 60a1694bec5a44d15456acc880cb2f91619f66aa /lib/AST/Decl.cpp | |
| parent | 8f57cb0305232cb53fff00ef151ca716766f3437 (diff) | |
Notes
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 a6996a4bfe5c..bdc804722c41 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)) |
