[cfe-commits] r117656 - in /cfe/trunk: lib/Sema/SemaLookup.cpp test/SemaCXX/lookup-member.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Oct 29 09:12:50 PDT 2010
Author: akirtzidis
Date: Fri Oct 29 11:12:50 2010
New Revision: 117656
URL: http://llvm.org/viewvc/llvm-project?rev=117656&view=rev
Log:
When doing name lookup for members don't look into global/namespace scope.
Better performance and fixes rdar://8603569.
Added:
cfe/trunk/test/SemaCXX/lookup-member.cpp
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=117656&r1=117655&r2=117656&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Fri Oct 29 11:12:50 2010
@@ -918,6 +918,10 @@
// FIXME: This really, really shouldn't be happening.
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
// nominated namespaces by those using-directives.
//
Added: cfe/trunk/test/SemaCXX/lookup-member.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/lookup-member.cpp?rev=117656&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/lookup-member.cpp (added)
+++ cfe/trunk/test/SemaCXX/lookup-member.cpp Fri Oct 29 11:12:50 2010
@@ -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;
+};
More information about the cfe-commits
mailing list