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 (!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.

View File

@ -56,12 +56,16 @@ namespace Other {
namespace M2 {
using namespace Other;
extern "C" {
namespace MInner {
extern "C" {
class Bar {
void bar();
};
}
}
}
}
void M2::MInner::Bar::bar() {
other_foo();