summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 2aa67fb8626..1b33f45f4da 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -588,9 +588,13 @@ void Preprocessor::verifyModuleInclude(SourceLocation FilenameLoc,
Module *RequestingModule = getModuleForLocation(FilenameLoc);
if (RequestingModule)
HeaderInfo.getModuleMap().resolveUses(RequestingModule, /*Complain=*/false);
+ bool FoundInModule = false;
ModuleMap::KnownHeader RequestedModule =
- HeaderInfo.getModuleMap().findModuleForHeader(IncFileEnt,
- RequestingModule);
+ HeaderInfo.getModuleMap().findModuleForHeader(
+ IncFileEnt, RequestingModule, &FoundInModule);
+
+ if (!FoundInModule)
+ return; // The header is not part of a module.
if (RequestingModule == RequestedModule.getModule())
return; // No faults wihin a module, or between files both not in modules.
OpenPOWER on IntegriCloud