From cc1b82be17a8a100857cd1830d8704a8531f11d9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 23 May 2016 20:03:04 +0000 Subject: Fix filtering of prior declarations when checking for a tag redeclaration to map to the redecl context for both decls, not just one of them, and to properly check that the decl contexts are equivalent. llvm-svn: 270482 --- clang/lib/Sema/SemaDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 9c442a61ce2..81460418ca4 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -12338,7 +12338,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, LookupResult::Filter F = Previous.makeFilter(); while (F.hasNext()) { NamedDecl *ND = F.next(); - if (ND->getDeclContext()->getRedeclContext() != SearchDC) + if (!ND->getDeclContext()->getRedeclContext()->Equals( + SearchDC->getRedeclContext())) F.erase(); } F.done(); -- cgit v1.2.3