CLion 2023.2 C++20 Modules Support on GCC: Incomplete IDE Error Highlighting
24.5K reputation · 18 Jan 2020, 01:06 UTC
CLion 2023.2 introduced preliminary C++20 module support, but the feature is limited to the Clang compiler. When a CMake project targets GCC 11 or newer and includes a module interface unit, the IDE marks the file as an error, even though GCC compiles the module without issue.
Additionally, the IDE’s module import completion is incomplete and it fails to propagate GCC‑specific module flags (e.g., -fmodules-ts) from CMake to the compiler during module build steps. The “Add CMake option” dialog accepts arbitrary options, yet the module build silently ignores them, causing build failures.
Given these constraints, the goal is to understand the root cause of the IDE error highlighting and the missing flag propagation, and to determine whether this represents a known limitation that will be addressed in future releases or if a workaround is required for cross‑platform builds.
Why does CLion 2023.2 flag GCC module interface units as errors while GCC compiles them successfully?
What steps can be taken to ensure the IDE correctly recognizes and propagates module flags during module build steps?
Will upcoming CLion releases provide full GCC module support?