]> granicus.if.org Git - clang/commitdiff
Minor tweak to name lookup for C/Objective-C: after the first name, still consider...
authorDouglas Gregor <dgregor@apple.com>
Tue, 3 Jan 2012 23:34:23 +0000 (23:34 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 3 Jan 2012 23:34:23 +0000 (23:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147499 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp

index f836a077b6bb045dff2d5ec1c8576b7d712bbfc6..48ae1b970ddabc44c4aa0439f73e63c634232dd7 100644 (file)
@@ -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);
         }