]> granicus.if.org Git - clang/commitdiff
From Vassil Vassilev: unnamed decls cannot be removed from the lookup map.
authorAxel Naumann <Axel.Naumann@cern.ch>
Fri, 26 Aug 2011 14:06:12 +0000 (14:06 +0000)
committerAxel Naumann <Axel.Naumann@cern.ch>
Fri, 26 Aug 2011 14:06:12 +0000 (14:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138631 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclBase.cpp

index 43a1c24149fc7edcf7de688429b72444166348d8..8b1acb1996415b2841ce3d3ecaf3070e9e5a9ece 100644 (file)
@@ -969,6 +969,9 @@ void DeclContext::removeDecl(Decl *D) {
   if (isa<NamedDecl>(D)) {
     NamedDecl *ND = cast<NamedDecl>(D);
 
+    // Remove only decls that have a name
+    if (!ND->getDeclName()) return;
+
     StoredDeclsMap *Map = getPrimaryContext()->LookupPtr;
     if (!Map) return;