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 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.
|
||||||
|
|
|
@ -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();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue