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

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 19 00:48:44 PDT 2023


ChuanqiXu9 wrote:

> When I suggested this, it was an intention to limit it to C++ std library headers. Do we not have some existing mechanism that knows which headers are in this category (for typo correction etc?)

As far as I can reach, we don't have such a mechanism. I was wondering if we can do this by using `#  pragma GCC system_header`. But it shows that the libcxx don't always use this pragma.

Also I feel it makes sense to not include other system headers. e.g., in our coding standards, we need `<>` to include boost headers and the sys headers (e.g., #include <sys/mman.h>)

> 
> My concern with making it more general is that it then covers things like frameworks which are also included like `<Framework/....>` (of course, it's also probably not what was intended there as well)
> 
> Let's add @Bigcheese to the reviewers, for an opinion on Frameworks

What do you mean by frameworks? Do you mean something used in apple modules? If yes, the current implementation shouldn't cover that. Since I add this warning only after we handled import.

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


More information about the cfe-commits mailing list