[PATCH] D125773: [Driver] Do not auto-enable header modules with -std=c++20

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 20 08:41:46 PDT 2022


ilya-biryukov added a comment.

In D125773#3525215 <https://reviews.llvm.org/D125773#3525215>, @tahonermann wrote:

>> So the proposal is that -fheader-modules=parse would parse #include of header unit in the same TU, and import .pcm on import, right?
>
> Per cpp.includep7 <http://eel.is/c++draft/cpp.include#7>, "If the header identified by the //header-name// denotes an importable header ([module.import]), it is implementation-defined whether the #include preprocessing directive is instead replaced by an import directive ([cpp.import]) of the form
> import header-name ; new-line"
>
> For Clang, I would expect the implementation-defined behavior to derive from the existence of a module map that nominates a header as being importable.

Sure, that's what Clang does now. It's totally reasonable.
It seems we can get away with our use-case by passing `-fno-modules` flag as we don't really use C++20 modules. It should still provide the layering check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125773



More information about the cfe-commits mailing list