forked from OSchip/llvm-project
When doing name lookup for members don't look into global/namespace scope.
Better performance and fixes rdar://8603569. llvm-svn: 117656
This commit is contained in:
parent
a42c78fadb
commit
706bbf84d8
|
@ -918,6 +918,10 @@ bool Sema::CppLookupName(LookupResult &R, Scope *S) {
|
||||||
// FIXME: This really, really shouldn't be happening.
|
// FIXME: This really, really shouldn't be happening.
|
||||||
if (!S) return false;
|
if (!S) return false;
|
||||||
|
|
||||||
|
// If we are looking for members, no need to look into global/namespace scope.
|
||||||
|
if (R.getLookupKind() == LookupMemberName)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Collect UsingDirectiveDecls in all scopes, and recursively all
|
// Collect UsingDirectiveDecls in all scopes, and recursively all
|
||||||
// nominated namespaces by those using-directives.
|
// nominated namespaces by those using-directives.
|
||||||
//
|
//
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||||
|
|
||||||
|
namespace A {
|
||||||
|
class String;
|
||||||
|
};
|
||||||
|
|
||||||
|
using A::String;
|
||||||
|
class String;
|
||||||
|
|
||||||
|
// rdar://8603569
|
||||||
|
union value {
|
||||||
|
char *String;
|
||||||
|
};
|
Loading…
Reference in New Issue