]> granicus.if.org Git - clang/commitdiff
Skip transparent contexts when looking for using directives in name lookup.
authorDouglas Gregor <dgregor@apple.com>
Tue, 9 Apr 2013 01:49:26 +0000 (01:49 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 9 Apr 2013 01:49:26 +0000 (01:49 +0000)
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

lib/Sema/SemaLookup.cpp
test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp

index ebe28944062c0b76021fec89e4eef018ecc4df86..b631d8b930a703f000b55f3d502dd97da75251b4 100644 (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.
index 272ad8568c9edfc7c9ec2c50c2f3a3a019061e85..6fba972989816a056494782c1fdd162e31a24d2f 100644 (file)
@@ -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();
+        };
+      }
+    }
   }
 }