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:
parent
25049096cb
commit
8ccbc18efa
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue