summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-04-21 19:49:57 +0000
committerBen Langmuir <blangmuir@apple.com>2014-04-21 19:49:57 +0000
commitb36744fe467ec4f7adbce29a5f4f3f77c7ea695d (patch)
treedebc4f9a52c87021fbba2f3edd6bb5cffbf58d24
parentf9d2832618bdfdcb2fb6673a0ff0464fd1e6affa (diff)
downloadclang-b36744fe467ec4f7adbce29a5f4f3f77c7ea695d.tar.gz
clang-b36744fe467ec4f7adbce29a5f4f3f77c7ea695d.tar.bz2
clang-b36744fe467ec4f7adbce29a5f4f3f77c7ea695d.tar.xz
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
-rw-r--r--lib/Lex/ModuleMap.cpp3
-rw-r--r--test/Modules/Inputs/submodules/module.map6
2 files changed, 8 insertions, 1 deletions
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 *
+}