r179079 - Skip transparent contexts when looking for using directives in name lookup.

Douglas Gregor dgregor at apple.com
Mon Apr 8 18:49:26 PDT 2013


Author: dgregor
Date: Mon Apr  8 20:49:26 2013
New Revision: 179079

URL: http://llvm.org/viewvc/llvm-project?rev=179079&view=rev
Log:
Skip transparent contexts when looking for using directives in name lookup.

Fixes the bootstrap regression I introduced in r179067.

Modified:
    cfe/trunk/lib/Sema/SemaLookup.cpp
    cfe/trunk/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp

Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=179079&r1=179078&r2=179079&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Mon Apr  8 20:49:26 2013
@@ -962,8 +962,12 @@ bool Sema::CppLookupName(LookupResult &R
           // 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.

Modified: cfe/trunk/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp?rev=179079&r1=179078&r2=179079&view=diff
==============================================================================
--- cfe/trunk/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp (original)
+++ cfe/trunk/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp Mon Apr  8 20:49:26 2013
@@ -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();
+        };
+      }
+    }
   }
 }
 





More information about the cfe-commits mailing list