From 8ccbc18efa244023edd07661f4b23c9d42a20819 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 9 Apr 2013 01:49:26 +0000 Subject: [PATCH] Skip transparent contexts when looking for using directives in name lookup. Fixes the bootstrap regression I introduced in r179067. llvm-svn: 179079 --- clang/lib/Sema/SemaLookup.cpp | 6 +++++- .../basic/basic.lookup/basic.lookup.unqual/p14.cpp | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index ebe28944062c..b631d8b930a7 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -962,8 +962,12 @@ bool Sema::CppLookupName(LookupResult &R, Scope *S) { // If we haven't handled using directives yet, do so now. if (!VisitedUsingDirectives) { // Add using directives from this context up to the top level. - for (DeclContext *UCtx = Ctx; UCtx; UCtx = UCtx->getParent()) + for (DeclContext *UCtx = Ctx; UCtx; UCtx = UCtx->getParent()) { + if (UCtx->isTransparentContext()) + continue; + UDirs.visit(UCtx, UCtx); + } // Find the innermost file scope, so we can add using directives // from local scopes. diff --git a/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp b/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp index 272ad8568c9e..6fba97298981 100644 --- a/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp +++ b/clang/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp @@ -56,10 +56,14 @@ namespace Other { namespace M2 { using namespace Other; - namespace MInner { - class Bar { - void bar(); - }; + extern "C" { + namespace MInner { + extern "C" { + class Bar { + void bar(); + }; + } + } } }