Argiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49631 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index c062e80..57e8d0a 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -123,7 +123,7 @@
// 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)) {