Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions clang/lib/Lex/ModuleMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ void ModuleMap::resolveHeader(Module *Mod,
} else if (Header.HasBuiltinHeader && !Header.Size && !Header.ModTime) {
// There's a builtin header but no corresponding on-disk header. Assume
// this was supposed to modularize the builtin header alone.
} else if (Header.Kind == Module::HK_Excluded) {
// Ignore missing excluded header files. They're optional anyway.
} else if ((Header.Kind == Module::HK_Excluded) ||
(Header.Kind == Module::HK_Textual)) {
// Ignore excluded and textual header files as a module can be built with
// such headers missing.
} else {
// If we find a module that has a missing header, we mark this module as
// unavailable and store the header directive for displaying diagnostics.
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Modules/Inputs/submodules/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ module missing_umbrella_with_inferred_submodules {
module * { export * }
export *
}

module missing_textual_header {
textual header "missing_textual.h"
}
3 changes: 3 additions & 0 deletions clang/test/Modules/missing-header.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
@import missing_unavailable_headers.not_missing; // OK
// CHECK-NOT: missing_unavailable_headers

@import missing_textual_header; // OK
// CHECK-NOT: missing_textual_header

@import missing_headers;
// CHECK: module.modulemap:15:27: error: header 'missing.h' not found
// CHECK: could not build module 'missing_headers'