aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-04-09 01:49:26 +0000
committerDouglas Gregor <dgregor@apple.com>2013-04-09 01:49:26 +0000
commit34366208e3ec6876ef501e85978466d2ddecb3d2 (patch)
tree01beb42d4e5f9982426e68027d85a8a8caa36a19
parent391ca9f2c9e9b93fe7196b56f20701cbb6dc0dd7 (diff)
Skip transparent contexts when looking for using directives in name lookup.
Fixes the bootstrap regression I introduced in r179067. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179079 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaLookup.cpp6
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp12
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index ebe2894406..b631d8b930 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/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/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp
index 272ad8568c..6fba972989 100644
--- a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp
+++ b/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();
+ };
+ }
+ }
}
}