From: Ben Langmuir Date: Mon, 21 Apr 2014 19:49:57 +0000 (+0000) Subject: Allow submodule inferrences with a missing umbrella when the module is unavailable X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b36744fe467ec4f7adbce29a5f4f3f77c7ea695d;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206776 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index 0e712b0dce..068e16d043 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/lib/Lex/ModuleMap.cpp @@ -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; } diff --git a/test/Modules/Inputs/submodules/module.map b/test/Modules/Inputs/submodules/module.map index 27c1ee4c61..1c1b76a089 100644 --- a/test/Modules/Inputs/submodules/module.map +++ b/test/Modules/Inputs/submodules/module.map @@ -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 * +}