diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-25 00:36:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-25 00:36:19 +0000 |
commit | dc355713be51fcb4ee52d9fd6b4548ceff47fadf (patch) | |
tree | eb1eee27bd2a2ddf32d520822adef83d7e982890 /lib/AST/Decl.cpp | |
parent | 670d6ed9f058526af4c07724f7da50139e252a22 (diff) |
Update UsingDecl, UnresolvedUsingTypenameDecl, and
UnresolvedUsingValueDecl to use NestedNameSpecifierLoc rather than the
extremely-lossy NestedNameSpecifier/SourceRange pair it used to use,
improving source-location information.
Various infrastructure updates to support NestedNameSpecifierLoc:
- AST/PCH (de-)serialization
- Recursive AST visitor
- libclang traversal (including the first tests of this
functionality)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index c0300c50cd..ccc883e944 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -868,9 +868,13 @@ bool NamedDecl::declarationReplaces(NamedDecl *OldD) const { return cast<UsingShadowDecl>(this)->getTargetDecl() == cast<UsingShadowDecl>(OldD)->getTargetDecl(); - if (isa<UsingDecl>(this) && isa<UsingDecl>(OldD)) - return cast<UsingDecl>(this)->getTargetNestedNameDecl() == - cast<UsingDecl>(OldD)->getTargetNestedNameDecl(); + if (isa<UsingDecl>(this) && isa<UsingDecl>(OldD)) { + ASTContext &Context = getASTContext(); + return Context.getCanonicalNestedNameSpecifier( + cast<UsingDecl>(this)->getQualifier()) == + Context.getCanonicalNestedNameSpecifier( + cast<UsingDecl>(OldD)->getQualifier()); + } // For non-function declarations, if the declarations are of the // same kind then this must be a redeclaration, or semantic analysis |