]> granicus.if.org Git - clang/commitdiff
Allow submodule inferrences with a missing umbrella when the module is unavailable
authorBen Langmuir <blangmuir@apple.com>
Mon, 21 Apr 2014 19:49:57 +0000 (19:49 +0000)
committerBen Langmuir <blangmuir@apple.com>
Mon, 21 Apr 2014 19:49:57 +0000 (19:49 +0000)
If the module is unavailable because of a missing header, don't diagnose
a "module * {}" declaration for having a missing umbrella.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206776 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/ModuleMap.cpp
test/Modules/Inputs/submodules/module.map

index 0e712b0dce6e655d5c3dea2d34c5fa7bb9a7f431..068e16d043103b8f886a08c25596a98f351f53e4 100644 (file)
@@ -1988,7 +1988,8 @@ void ModuleMapParser::parseInferredModuleDecl(bool Framework, bool Explicit) {
 
   if (ActiveModule) {
     // Inferred modules must have umbrella directories.
-    if (!Failed && !ActiveModule->getUmbrellaDir()) {
+    if (!Failed && ActiveModule->IsAvailable &&
+        !ActiveModule->getUmbrellaDir()) {
       Diags.Report(StarLoc, diag::err_mmap_inferred_no_umbrella);
       Failed = true;
     }
index 27c1ee4c615e69f15fe67f48e0886a84c00d569c..1c1b76a08969e52902416291034203e8bbf63c1a 100644 (file)
@@ -24,3 +24,9 @@ module missing_unavailable_headers {
   }
   module not_missing { }
 }
+
+module missing_umbrella_with_inferred_submodules {
+  umbrella header "missing_umbrella.h"
+  module * { export * }
+  export *
+}