aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorAxel Naumann <Axel.Naumann@cern.ch>2011-11-08 18:21:06 +0000
committerAxel Naumann <Axel.Naumann@cern.ch>2011-11-08 18:21:06 +0000
commitd9d137e6bc54bad6a7aa64b667aea22230e8264b (patch)
tree3cd91fd62d30742339a7f906fe6a9faff3c0cc35 /lib/AST/DeclBase.cpp
parentc44bc2d32f81d11b4c0e46c932ba42e673b50a49 (diff)
From Vassil Vassilev: add checks for removing Decls for more use cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 4c31bbd3d7..d892c56f71 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -987,7 +987,8 @@ void DeclContext::removeDecl(Decl *D) {
StoredDeclsMap::iterator Pos = Map->find(ND->getDeclName());
assert(Pos != Map->end() && "no lookup entry for decl");
- Pos->second.remove(ND);
+ if (Pos->second.getAsVector() || Pos->second.getAsDecl() == ND)
+ Pos->second.remove(ND);
}
}