diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-04-11 01:03:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-04-11 01:03:38 +0000 |
commit | 83e78f5c3c3dbf8a29d615ceb84a70163a38f42e (patch) | |
tree | 76501ef34779c54b08f425651b76d1594f615c76 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 917f97f1a350fcc2d754b5280d154c0fd8a38360 (diff) | |
download | bcm5719-llvm-83e78f5c3c3dbf8a29d615ceb84a70163a38f42e.tar.gz bcm5719-llvm-83e78f5c3c3dbf8a29d615ceb84a70163a38f42e.zip |
Fix handling of redeclaration lookup for using declarations, where the prior
declaration is not visible. Previously we didn't find hidden friend names in
this redeclaration lookup, because we forgot to treat it as a redeclaration
lookup. Conversely, we did find some local extern names, but those don't
actually conflict with a namespace-scope using declaration, because the only
conflicts we can get are scope conflicts, not conflicts due to the entities
being members of the same namespace.
llvm-svn: 206011
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 850db26e9af..fbc3fd7eb81 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -7379,6 +7379,13 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS, NamedDecl *D = F.next(); if (!isDeclInScope(D, CurContext, S)) F.erase(); + // If we found a local extern declaration that's not ordinarily visible, + // and this declaration is being added to a non-block scope, ignore it. + // We're only checking for scope conflicts here, not also for violations + // of the linkage rules. + else if (!CurContext->isFunctionOrMethod() && D->isLocalExternDecl() && + !(D->getIdentifierNamespace() & Decl::IDNS_Ordinary)) + F.erase(); } F.done(); } else { |