[clang] [C++20] [Modules] Warn if we found #include <filename> in module purview (PR #69555)

Iain Sandoe via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 19 00:54:17 PDT 2023


================
@@ -922,6 +922,10 @@ def err_header_import_semi_in_macro : Error<
 def err_header_import_not_header_unit : Error<
   "header file %0 (aka '%1') cannot be imported because "
   "it is not known to be a header unit">;
+def warn_pp_include_angled_in_module_purview : Warning<
+  "'#include <filename>' in the module purview appears to be erroneous; "
----------------
iains wrote:

I agree in general that limiting it to '<...>' seems a reasonable filter; either people should be `import`-ing or `#include "..." ` - but let's also get Michael's opinion.

text-wise - maybe something like:
`#include <xxxx> attaches the declarations to the named module 'M', which is not usually intended;` (where we can name M in the message).


https://github.com/llvm/llvm-project/pull/69555


More information about the cfe-commits mailing list