summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-03-14 17:52:37 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-03-14 17:52:37 +0000
commit8d4e90b3197fc36a1a7c0fcad96e13f1f1f93029 (patch)
tree67f664e05cefef64ad41486d53c89591696a6ad2 /clang/lib/Lex/ModuleMap.cpp
parent57195841291c581146cf0890172c69b066d0ec6f (diff)
downloadbcm5719-llvm-8d4e90b3197fc36a1a7c0fcad96e13f1f1f93029.tar.gz
bcm5719-llvm-8d4e90b3197fc36a1a7c0fcad96e13f1f1f93029.zip
[modules] Don't diagnose non-modular includes from modular files that are
implementation units of modules rather than interface units. llvm-svn: 263449
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 5e103a054d5..69cb574e2a0 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -239,6 +239,7 @@ static Module *getTopLevelOrNull(Module *M) {
}
void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule,
+ bool RequestingModuleIsModuleInterface,
SourceLocation FilenameLoc,
StringRef Filename,
const FileEntry *File) {
@@ -301,7 +302,7 @@ void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule,
if (LangOpts.ModulesStrictDeclUse) {
Diags.Report(FilenameLoc, diag::err_undeclared_use_of_module)
<< RequestingModule->getFullModuleName() << Filename;
- } else if (RequestingModule) {
+ } else if (RequestingModule && RequestingModuleIsModuleInterface) {
diag::kind DiagID = RequestingModule->getTopLevelModule()->IsFramework ?
diag::warn_non_modular_include_in_framework_module :
diag::warn_non_modular_include_in_module;
OpenPOWER on IntegriCloud