Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] [Modules] Conform the requirement to the suffix for interface units #57416

Open
ChuanqiXu9 opened this issue Aug 29, 2022 · 5 comments
Open
Labels
c++ clang:modules C++20 modules and Clang Header Modules

Comments

@ChuanqiXu9
Copy link
Member

Currently, clang requires the filename of interface units ends with .cppm (or .ccm, .cxxm, .c++m). However, MSVC and GCC make different choices. It will be better to make them consistent and SG15 (Tooling subgroup) are working on it.

@ChuanqiXu9 ChuanqiXu9 added c++ clang:modules C++20 modules and Clang Header Modules labels Aug 29, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 29, 2022

@llvm/issue-subscribers-c-1

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 29, 2022

@llvm/issue-subscribers-clang-modules

@bjornr
Copy link

bjornr commented Apr 30, 2023

I am not sure it is correct to say these filename extensions are required. It seems cmake experimentL C++20 module support work with named module interface units that all have .cpp filename extensions. Perhaps they create temporary renamed "source" files as work-around, or is this issue solved? I use clang 10.0.2 and instructions here :
https://www.kitware.com/import-cmake-c20-modules/

@ChuanqiXu9
Copy link
Member Author

not sure it is correct to say these filename extensions are required. It seems cmake experimentL C++20 module support work with named module interface units that all have .cpp filename extensions. Perhaps they create temporary renamed "source" files as work-around, or is this issue solved? I use clang 10.0.2 and instructions

This issue is not solved but it doesn't matter so much now since the build system will try to handle them.

The reason why clang want a special suffix for module interfaces is that clang want to know that we're compiling a module interface from the command line. So it is also good to pass -x c++-module explicitly in the command line for module interfaces ends with .cpp. So the build systems are able to control this.

BTW, clang10 doesn't support modules. The minimum version to support modules and clang-scan-deps is clang16.

@bjornr
Copy link

bjornr commented May 13, 2023

Thanks for reply!

BTW, clang10 doesn't support modules. The minimum version to support modules and clang-scan-deps is clang16.

Typo, should have been 16.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ clang:modules C++20 modules and Clang Header Modules
Projects
None yet
Development

No branches or pull requests

3 participants