[PATCH] D156948: [clang][modules] Add -Wsystem-headers-in-module=

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 09:39:54 PDT 2023


jansvoboda11 accepted this revision.
jansvoboda11 added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/include/clang/Basic/DiagnosticOptions.h:128
+  /// whether -Wsystem-headers is enabled on a per-module basis.
+  std::vector<std::string> SystemHeaderWarningsModules;
+
----------------
Out of interest, is there an existing use-case for having multiple modules here, or is this just future-proofing?


================
Comment at: clang/lib/Frontend/CompilerInstance.cpp:1238-1239
 
+  for (StringRef Name : DiagOpts.SystemHeaderWarningsModules)
+    if (Name == ModuleName)
+      Instance.getDiagnostics().setSuppressSystemWarnings(false);
----------------
I assume `llvm::is_contained()` wouldn't be okay with the `std::string` and `StringRef` mismatch?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156948/new/

https://reviews.llvm.org/D156948



More information about the cfe-commits mailing list