[PATCH] D156948: [clang][modules] Add -Wsystem-headers-in-module=
Ben Langmuir via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 4 10:01:43 PDT 2023
benlangmuir marked an inline comment as done.
benlangmuir added inline comments.
================
Comment at: clang/include/clang/Basic/DiagnosticOptions.h:128
+ /// whether -Wsystem-headers is enabled on a per-module basis.
+ std::vector<std::string> SystemHeaderWarningsModules;
+
----------------
jansvoboda11 wrote:
> Out of interest, is there an existing use-case for having multiple modules here, or is this just future-proofing?
I'm not using it currently, but I think it makes sense to handle any number. You could have multiple such modules you're testing together.
================
Comment at: clang/lib/Frontend/CompilerInstance.cpp:1238-1239
+ for (StringRef Name : DiagOpts.SystemHeaderWarningsModules)
+ if (Name == ModuleName)
+ Instance.getDiagnostics().setSuppressSystemWarnings(false);
----------------
jansvoboda11 wrote:
> I assume `llvm::is_contained()` wouldn't be okay with the `std::string` and `StringRef` mismatch?
Nope, I just didn't think of it here for some reason. Updated.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156948/new/
https://reviews.llvm.org/D156948
More information about the cfe-commits
mailing list