]> granicus.if.org Git - clang/commitdiff
Make sure that name lookup in C checks whether a name is hidden.
authorDouglas Gregor <dgregor@apple.com>
Fri, 2 Dec 2011 20:08:44 +0000 (20:08 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 2 Dec 2011 20:08:44 +0000 (20:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145700 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp
test/Modules/Inputs/module.map

index 5964d7232a85bde74088422de43621d06d16b588..c232515ef365623da3d8e11e4a991034f0341001 100644 (file)
@@ -1123,6 +1123,11 @@ bool Sema::LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation) {
                  !isa<ImplicitParamDecl>(*I))
           continue;
         
+        // If this declaration is module-private and it came from an AST
+        // file, we can't see it.
+        if ((*I)->isModulePrivate() && (*I)->isFromASTFile())
+          continue;
+            
         R.addDecl(*I);
 
         if ((*I)->getAttr<OverloadableAttr>()) {
index d18b9f7505f600cbd6b4988bb14792e5afae7768..7d8d11f9579319a5645edf39ceaee37b7f2de8f9 100644 (file)
@@ -21,9 +21,19 @@ module module_private_left { header "module_private_left.h" }
 module module_private_right { header "module_private_right.h" }
 module macros { header "macros.h" }
 module category_top { header "category_top.h" }
-module category_left { header "category_left.h" }
-module category_right { header "category_right.h" }
-module category_bottom { header "category_bottom.h" }
+module category_left { 
+  header "category_left.h" 
+  export category_top
+}
+module category_right { 
+  header "category_right.h" 
+  export category_top
+}
+module category_bottom { 
+  header "category_bottom.h" 
+  export category_left
+  export category_right
+}
 module redeclarations_left { header "redeclarations_left.h" }
 module redeclarations_right { header "redeclarations_right.h" }
 module load_failure { header "load_failure.h" }