Will CLion support C++ 20 Modules eventually?

已回答

I like CLion, I like how smooth it is, but I don't like that there is no support for C++ Modules, that's why I have to use Visual Studio 2022 sadly... 

Here's my question: Will CLion have C++ 20 Modules support eventually soon, or is it being worked on right now? Because I would highly like to see SMOTH C++ 20 Modules support on an IDE. 

Thanks for making CLion :D 

5

Similarly, I could not figure out how to #include <ranges> in CLion MinGW Lavavaj Boost 1.76 and had to back out to Visual Studio. That made me sad. I'd much rather use CLion

0

Luka Which project model do you use? CMake, for example, still doesn't have support for C++20 modules - https://gitlab.kitware.com/cmake/cmake/-/issues/18355. Feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-19267. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

Brian Beckman does the compiler you use support the ranges library? The first release to support Ranges in gcc is gcc 10.1 - https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020.

1

Here is a project skeleton that works with CMake and CLion https://github.com/xahon/c-modules-with-cmake
The main issue is that CLion is unable to parse definitions. If it could do it, then we should already be able to use c++ modules

4

IC Which CMake version do you use for that?

0

I don't remember it was a month ago. How does cmake affect code parsing? I've set appropriate compiler version in toolchain so that should work. AFAIK cmake still doesn't support c++ modules natively and I wrote a workaround function to make it work

0

IC CLion uses information taken from CMake about which files are included into the projects, what are the header search paths, etc. So this might affect parsing.

0
Avatar
Permanently deleted user

I use my own Gradle plugin to compile C++20 modules projects. It also is able to produce compilation database which can be loaded into CLion. The CLion still have a problem with some compiler arguments here, but even after these arguments are removed from JSON and the compilation DB is successfully loaded, it still cannot properly navigate through a project code. Module imports are not recognized. Errors are not recognized (Clang-tidy not working?).

0

@... Code highlighting and analyzer warning are coming from Clang. I don't think Clang has the proper support yet.

0

请先登录再写评论。