Allow submodule inferrences with a missing umbrella when the module is unavailable

If the module is unavailable because of a missing header, don't diagnose
a "module * {}" declaration for having a missing umbrella.

llvm-svn: 206776
This commit is contained in:
Ben Langmuir
2014-04-21 19:49:57 +00:00
parent 6d23a7b600
commit 4898cde4e1
2 changed files with 8 additions and 1 deletions

View 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;
}

View 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 *
}