diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-04 08:48:52 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-04 08:48:52 +0000 |
commit | c80117e7971c34088f3e254c849ec3a40205d2c3 (patch) | |
tree | dab57fcb4e8f5995fc553976ec67ecc72233acbf /lib/AST/Decl.cpp | |
parent | 2bd6250f8e14750033362664ee298c2cc0e64853 (diff) |
Don't be so eager to replace UsingDecls in a DeclContext's lookup table;
check that the TargetNestedNameDecl is the same first.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index ca963ad7e5..c6c7649bda 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -732,6 +732,10 @@ 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(); + // 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. |