From a24eb4ef63d5860a5a02f7532e56e84283782984 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 24 Aug 2009 18:55:03 +0000 Subject: [PATCH] Skip transparent contexts when performing C++ name lookup git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79931 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaLookup.cpp | 3 +++ test/SemaCXX/linkage-spec.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index c600f99a40..1d583cc391 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -755,6 +755,9 @@ Sema::CppLookupName(Scope *S, DeclarationName Name, for (; S; S = S->getParent()) { DeclContext *Ctx = static_cast(S->getEntity()); + if (Ctx->isTransparentContext()) + continue; + assert(Ctx && Ctx->isFileContext() && "We should have been looking only at file context here already."); diff --git a/test/SemaCXX/linkage-spec.cpp b/test/SemaCXX/linkage-spec.cpp index 864953e9f9..b4c72f557d 100644 --- a/test/SemaCXX/linkage-spec.cpp +++ b/test/SemaCXX/linkage-spec.cpp @@ -25,3 +25,11 @@ extern "C" int const bar; // 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 -- 2.40.0