summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index f0dcc1a1492..689ef73b466 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -243,8 +243,12 @@ void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule,
resolveUses(RequestingModule, /*Complain=*/false);
HeadersMap::iterator Known = findKnownHeader(File);
- if (Known == Headers.end())
+ if (Known == Headers.end()) {
+ if (LangOpts.ModulesStrictDeclUse)
+ Diags.Report(FilenameLoc, diag::error_undeclared_use_of_module)
+ << RequestingModule->getFullModuleName() << Filename;
return;
+ }
Module *Private = NULL;
Module *NotUsed = NULL;
OpenPOWER on IntegriCloud