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

Add support for C++ modules #411

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Add support for C++ modules #411

merged 1 commit into from
Sep 11, 2023

Conversation

perryjiang
Copy link
Contributor

@perryjiang perryjiang commented Sep 9, 2023

Clang: https://clang.llvm.org/docs/StandardCPlusPlusModules.html

The file name of an importable module unit should end with .cppm (or .ccm, .cxxm, .c++m). The file name of a module implementation unit should end with .cpp (or .cc, .cxx, .c++).

I added support for the c++ file extension too.

Also, clang-format: https://github.com/llvm/llvm-project/blob/676629598595605dd673eeca9036609d13b6e193/clang/tools/clang-format/git-clang-format#L92

MSVC: https://devblogs.microsoft.com/cppblog/a-tour-of-cpp-modules-in-visual-studio/

C++20 introduces new keywords to define and consume modules and Visual Studio uses a new file type “.ixx” to define a module’s interface.

I couldn't find an authoritative source for GCC. https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Modules.html doesn't say anything.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit cc7bf02 into pre-commit:main Sep 11, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants