summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-04 08:48:52 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-04 08:48:52 +0000
commit4b52007c35d28d321e1e1b1d6df09d9df5558788 (patch)
treeaec36e12d8be72df1a42ea946f5cf6e3a7ceb5e8 /clang/lib/AST/Decl.cpp
parentba37e1eb49c41689bbf0478fb44e66183203dd13 (diff)
downloadbcm5719-llvm-4b52007c35d28d321e1e1b1d6df09d9df5558788.tar.gz
bcm5719-llvm-4b52007c35d28d321e1e1b1d6df09d9df5558788.zip
Don't be so eager to replace UsingDecls in a DeclContext's lookup table;
check that the TargetNestedNameDecl is the same first. llvm-svn: 118239
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index ca963ad7e59..c6c7649bdac 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud