From: Douglas Gregor Date: Tue, 3 Jan 2012 23:34:23 +0000 (+0000) Subject: Minor tweak to name lookup for C/Objective-C: after the first name, still consider... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f26e0fdcdb58742b7d7871cb42b6a28e7847262;p=clang Minor tweak to name lookup for C/Objective-C: after the first name, still consider whether this is a redeclaration lookup when determining whether to look for the visible declaration git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147499 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index f836a077b6..48ae1b970d 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1196,7 +1196,7 @@ bool Sema::LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation) { if (!(*LastI)->isInIdentifierNamespace(IDNS)) continue; - D = getVisibleDecl(*LastI); + D = R.isForRedeclaration()? *LastI : getVisibleDecl(*LastI); if (D) R.addDecl(D); }