]> granicus.if.org Git - clang/commitdiff
Skip transparent contexts when performing C++ name lookup
authorDouglas Gregor <dgregor@apple.com>
Mon, 24 Aug 2009 18:55:03 +0000 (18:55 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 24 Aug 2009 18:55:03 +0000 (18:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79931 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp
test/SemaCXX/linkage-spec.cpp

index c600f99a404652fc2b9e0776ee4ae62d0dd5c8b0..1d583cc391452ae9d03594afca93c03c0b1c2648 100644 (file)
@@ -755,6 +755,9 @@ Sema::CppLookupName(Scope *S, DeclarationName Name,
 
   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.");
 
index 864953e9f9c2fb320fcbcfb0fb0d3c0abc389963..b4c72f557d2ab8f34ef32aa0f5d2125f38bd1737 100644 (file)
@@ -25,3 +25,11 @@ extern "C" int const bar;
 // <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