CLion
 
Get CLion
Join the CLion 2025.1 Early Access Program and try out new features before they are released! Find out more

Support for C++20 Modules

Last modified: 26 May 2024

Modules were introduced in the C++20 standard. They work as alternative to some use cases of header files and help share declarations and definitions across translation units.

CLion collects information from .ixx, .cppm, and .mxx files, parses export module {name} statements and creates mappings between {name} and module filenames. Then, the mappings are passed to the Clangd engine and used to provide coding assistance and highlighting.

If you update the module’s code or rename the module, CLion will automatically parse the changes. The information collected from modules is preserved between the IDE restarts.

CLion's support for modules has been tested in the following environments:

  • CMake, Ninja generator, Visual Studio C++ toolchain.

  • CMake, Visual Studio generator, Visual Studio C++ toolchain.

  • CMake, Clang toolchain with compiler flags.