]> granicus.if.org Git - clang/commitdiff
Argiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl
authorDouglas Gregor <dgregor@apple.com>
Mon, 14 Apr 2008 00:26:07 +0000 (00:26 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 14 Apr 2008 00:26:07 +0000 (00:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49631 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/IdentifierResolver.cpp

index c062e8087537fa24f8f3754915ea100c103dde71..57e8d0a10349d87769e5e4c0017eaed3469cd729 100644 (file)
@@ -123,7 +123,7 @@ void IdentifierResolver::AddDecl(NamedDecl *D, Scope *S) {
   //   declarations shall all refer to the same object or
   //   enumerator, or all refer to functions and function templates;
   //   in this case the class name or enumeration name is hidden.
-  if (isa<TagDecl>(D)) {
+  if (isa<TagDecl>(D) && IDI->shadowed_end() != IDI->shadowed_begin()) {
     // We are pushing the name of a tag (enum or class).
     IdDeclInfo::ShadowedIter TopIter = IDI->shadowed_end() - 1;
     if (S->isDeclScope(*TopIter)) {