This DefaultIgnore warning under -Wincomplete-module was firing on
any module map files that happened to be parsed (it's only supposed to
fire on headers), and it has been superceded by
-Wnon-modular-include-in-module anyway.
For compatibility, I rewired -Wincomplete-module to imply
-Wnon-modular-include-in-module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221357
91177308-0d34-0410-b5e6-
96231b3b80d8
: DiagGroup<"incompatible-pointer-types",
[IncompatiblePointerTypesDiscardsQualifiers]>;
def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
-def IncompleteModule : DiagGroup<"incomplete-module", [IncompleteUmbrella]>;
def NonModularIncludeInFrameworkModule
: DiagGroup<"non-modular-include-in-framework-module">;
def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module",
[NonModularIncludeInFrameworkModule]>;
+def IncompleteModule : DiagGroup<"incomplete-module",
+ [IncompleteUmbrella, NonModularIncludeInModule]>;
+
def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
def warn_uncovered_module_header : Warning<
"umbrella header for module '%0' does not include header '%1'">,
InGroup<IncompleteUmbrella>;
-def warn_forgotten_module_header : Warning<
- "header '%0' is included in module '%1' but not listed in module map">,
- InGroup<IncompleteModule>, DefaultIgnore;
def err_expected_id_building_module : Error<
"expected a module name in '__building_module' expression">;
def error_use_of_private_header_outside_module : Error<
}
}
}
-
- // Check whether there are any headers that were included, but not
- // mentioned at all in the module map. Such headers
- SourceLocation StartLoc
- = SourceMgr.getLocForStartOfFile(SourceMgr.getMainFileID());
- if (!getDiagnostics().isIgnored(diag::warn_forgotten_module_header,
- StartLoc)) {
- ModuleMap &ModMap = getHeaderSearchInfo().getModuleMap();
- for (unsigned I = 0, N = SourceMgr.local_sloc_entry_size(); I != N; ++I) {
- // We only care about file entries.
- const SrcMgr::SLocEntry &Entry = SourceMgr.getLocalSLocEntry(I);
- if (!Entry.isFile())
- continue;
-
- // Dig out the actual file.
- const FileEntry *File = Entry.getFile().getContentCache()->OrigEntry;
- if (!File)
- continue;
-
- // If it's not part of a module and not unknown, complain.
- if (!ModMap.findModuleForHeader(File, nullptr,
- /*IncludeTextualHeaders*/true) &&
- !ModMap.isHeaderInUnavailableModule(File)) {
- Diag(StartLoc, diag::warn_forgotten_module_header)
- << File->getName() << Mod->getFullModuleName();
- }
- }
- }
}
return true;
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules-cache-path=%t -Wincomplete-module -fmodules -I %S/Inputs %s 2>&1 | FileCheck %s
-// CHECK: {{warning: header '.*incomplete_mod_missing.h' is included in module 'incomplete_mod' but not listed in module map}}
+// CHECK: warning: include of non-modular header inside module 'incomplete_mod'
+
+// RUN: rm -rf %t
+// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules-strict-decluse -fmodules -I %S/Inputs %s 2>&1 | FileCheck %s -check-prefix=DECLUSE
+// DECLUSE: error: module incomplete_mod does not depend on a module exporting {{'.*incomplete_mod_missing.h'}}