summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-04-11 01:03:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-04-11 01:03:38 +0000
commit83e78f5c3c3dbf8a29d615ceb84a70163a38f42e (patch)
tree76501ef34779c54b08f425651b76d1594f615c76 /clang/lib/Sema/SemaLookup.cpp
parent917f97f1a350fcc2d754b5280d154c0fd8a38360 (diff)
downloadbcm5719-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/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 39a1ceaa57e..172a07906da 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -244,10 +244,11 @@ static inline unsigned getIDNS(Sema::LookupNameKind NameKind,
IDNS = Decl::IDNS_Tag;
}
break;
+
case Sema::LookupLabel:
IDNS = Decl::IDNS_Label;
break;
-
+
case Sema::LookupMemberName:
IDNS = Decl::IDNS_Member;
if (CPlusPlus)
@@ -263,8 +264,10 @@ static inline unsigned getIDNS(Sema::LookupNameKind NameKind,
break;
case Sema::LookupUsingDeclName:
- IDNS = Decl::IDNS_Ordinary | Decl::IDNS_Tag
- | Decl::IDNS_Member | Decl::IDNS_Using;
+ assert(Redeclaration && "should only be used for redecl lookup");
+ IDNS = Decl::IDNS_Ordinary | Decl::IDNS_Tag | Decl::IDNS_Member |
+ Decl::IDNS_Using | Decl::IDNS_TagFriend | Decl::IDNS_OrdinaryFriend |
+ Decl::IDNS_LocalExtern;
break;
case Sema::LookupObjCProtocolName:
OpenPOWER on IntegriCloud