aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2020-04-17 20:25:15 -0700
committerRichard Smith <richard@metafoo.co.uk>2020-04-17 22:49:58 -0700
commit6bc7502385cc2a06954082a7d0e6418e610d35f4 (patch)
treeec3bac247a76bf492aa39a3679b59cd0e6eb28b7 /clang/lib/Basic/Module.cpp
parentfc76b4ad3da3c1f5fdc34370a55d613b3ca7af73 (diff)
downloadllvm-6bc7502385cc2a06954082a7d0e6418e610d35f4.zip
llvm-6bc7502385cc2a06954082a7d0e6418e610d35f4.tar.gz
llvm-6bc7502385cc2a06954082a7d0e6418e610d35f4.tar.bz2
When making modules transitively visible, don't take into account
whether they have missing header files. Whether a module's headers happen to be present on the local file system should make no difference to whether we make its contents visible when importing another module that re-exports it. If we have an up-to-date AST file that we can load, that's all that matters. This fixes the ability to header syntax checking for modular headers in C++20 mode (or in prior modes where -fmodules-local-submodule-visibility is enabled but -fmodules is not).
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r--clang/lib/Basic/Module.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 22e1da4..b3daaa3 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -654,8 +654,8 @@ void VisibleModuleSet::setVisible(Module *M, SourceLocation Loc,
SmallVector<Module *, 16> Exports;
V.M->getExportedModules(Exports);
for (Module *E : Exports) {
- // Don't recurse to unavailable submodules.
- if (E->isAvailable())
+ // Don't import non-importable modules.
+ if (!E->isUnimportable())
VisitModule({E, &V});
}