When checking the redeclaration context of a typedef that refers to a
tag of the same name, compare the lookup contexts rather than the
actual contexts. Fixes PR6923.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102437 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index d9696d9..fcee68d 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5029,7 +5029,8 @@
if (const TagType *TT = TD->getUnderlyingType()->getAs<TagType>()) {
TagDecl *Tag = TT->getDecl();
if (Tag->getDeclName() == Name &&
- Tag->getDeclContext()->Equals(TD->getDeclContext())) {
+ Tag->getDeclContext()->getLookupContext()
+ ->Equals(TD->getDeclContext()->getLookupContext())) {
PrevDecl = Tag;
Previous.clear();
Previous.addDecl(Tag);