Skip transparent contexts when looking for using directives in name lookup.

Fixes the bootstrap regression I introduced in r179067.

llvm-svn: 179079
This commit is contained in:
Douglas Gregor 2013-04-09 01:49:26 +00:00
parent 25049096cb
commit 8ccbc18efa
2 changed files with 13 additions and 5 deletions

View File

@ -962,8 +962,12 @@ bool Sema::CppLookupName(LookupResult &R, Scope *S) {
// If we haven't handled using directives yet, do so now. // If we haven't handled using directives yet, do so now.
if (!VisitedUsingDirectives) { if (!VisitedUsingDirectives) {
// Add using directives from this context up to the top level. // 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); UDirs.visit(UCtx, UCtx);
}
// Find the innermost file scope, so we can add using directives // Find the innermost file scope, so we can add using directives
// from local scopes. // from local scopes.

View File

@ -56,10 +56,14 @@ namespace Other {
namespace M2 { namespace M2 {
using namespace Other; using namespace Other;
namespace MInner { extern "C" {
class Bar { namespace MInner {
void bar(); extern "C" {
}; class Bar {
void bar();
};
}
}
} }
} }