[cfe-commits] r79931 - in /cfe/trunk: lib/Sema/SemaLookup.cpp test/SemaCXX/linkage-spec.cpp
Douglas Gregor
dgregor at apple.com
Mon Aug 24 11:55:03 PDT 2009
Author: dgregor
Date: Mon Aug 24 13:55:03 2009
New Revision: 79931
URL: http://llvm.org/viewvc/llvm-project?rev=79931&view=rev
Log:
Skip transparent contexts when performing C++ name lookup
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
cfe/trunk/test/SemaCXX/linkage-spec.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=79931&r1=79930&r2=79931&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Mon Aug 24 13:55:03 2009
@@ -755,6 +755,9 @@
for (; S; S = S->getParent()) {
DeclContext *Ctx = static_cast<DeclContext *>(S->getEntity());
+ if (Ctx->isTransparentContext())
+ continue;
+
assert(Ctx && Ctx->isFileContext() &&
"We should have been looking only at file context here already.");
Modified: cfe/trunk/test/SemaCXX/linkage-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/linkage-spec.cpp?rev=79931&r1=79930&r2=79931&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/linkage-spec.cpp (original)
+++ cfe/trunk/test/SemaCXX/linkage-spec.cpp Mon Aug 24 13:55:03 2009
@@ -25,3 +25,11 @@
// <rdar://problem/6895431>
extern "C" struct bar d;
extern struct bar e;
+
+extern "C++" {
+ namespace N0 {
+ struct X0 {
+ int foo(int x) { return x; }
+ };
+ }
+}
\ No newline at end of file
More information about the cfe-commits
mailing list