CLion now comes with CMake 3.23 bundled. It integrates better with CMake presets and makes updating CMake scripts and options easier.
The Quick Documentation popup is now available in CMake scripts. The documentation is shown for the standard CMake entities:
Documentation is always rendered for the currently bundled CMake version and is not available for the user-defined entities for now.
While editing CMake files in CLion, you can use auto-completion for CMake commands and variables with static names. In v2022.2, Qt-related commands were added to completion lists.
In CLion 2022.2, you can now review CMake cache variables and update CMake options that are passed to the CMake command in a single table-based UI in Settings | Build, Execution, Deployment | CMake.
When the table is in focus, start typing to search for a variable or its value. CLion also shows the short description in tooltips for CMake cache variables.
When auto-creating CLion profiles for all the configure and build presets, CLion now uses a new naming scheme for the CMake profiles created in CLion:
A copy action for profiles created from presets is enabled.
Colorized compiler output helps users deal with compilation errors much faster. That’s why we made our own contribution to CMake v3.24. We implemented a way to enable colorized output for the Ninja generator in CMake in CLion by default.
Note: CLion bundles CMake v3.23 for now. To get the colorized output, you need to get CMake 3.24 and use it in the CLion toolchain.
The Quick Documentation popup (Ctrl+Q) is a universal tool to help you get more information on a code element at the caret. By default, CLion shows quick documentation in a popup on mouseover automatically. In v2022.2, CLion has added more code insight to this documentation.
When reading through the code base, you often want to check the value of constant
expressions. CLion now shows the value of the expressions evaluated at compile time
in the Quick Documentation popup. This works for
constexpr, or template instantiations, just to name a few examples.
CLion 2022.2 makes it possible to see the enum value as an integer in the Quick Documentation popup.
It can be useful to see whether a given struct or class declaration supports copy and move operations, so CLion now shows this information in the Quick Documentation popup.
GDB servers are often used to debug on-chip. A new wizard helps with creating Embedded GDB Server run configurations with the predefined GDB server arguments corresponding to the GDB server type selected in the wizard settings. The supported types are:
We’re continuing to make code analysis in CLion more accurate. CLion 2022.2 removes many
incorrect warnings, adds new checks, and makes Clangd correctly recognize the
CLion’s data flow analysis now calculates the upper and lower bounds of the possible values for every integral variable. This provides extra information for checks like Unreachable code, Constant conditions, and others.
On top of this interval analysis, the Array index is out of bounds check is built. It reports variables that access an array or allocated buffer via the index which may be out of bounds.
If you prefer Clang-Tidy configuration files over IDE settings, select this option in Settings | Editor | Inspections | C/C++ | Static Analysis Tools | Clang-Tidy. In this case, a new widget will appear in the bottom right-hand corner of the editor:
The inspection settings in Settings | Editor | Inspections now visualize the highlighting style. When you want to change how an inspection appears in the editor, you can set it up using the new Highlighting in editor drop-down menu, which conveniently shows all available highlighting styles.
Valgrind Memcheck is a tool integrated into CLion for detecting memory usage problems. In v2022.2, we’ve enhanced the way configuration issues are reported. CLion now notifies you when Valgrind Memcheck is launched for the release configuration and the debug information is missing for the executable as a result.
When debugging, sometimes the library symbols are not available on your local machine. In this case, you can use a symbol server, a file server that stores your debug symbols centrally on a server rather than on each developer’s machine. In CLion on Windows, you can now configure symbol servers for the debugger in Settings | Build, Execution, Deployment | Debugger | Symbol Servers.
CLion v2022.2 bundles GDB v12.1 and LLDB v14.
To improve the performance of compiler information collection for the Docker toolchain,
CLion now uses Docker
exec instead of
Usually toolchains in Docker images have an environment file located inside the image. CLion now correctly picks the file from inside the container.
IntelliJ Rust now takes
#![recursion_limit] into account, which controls the macro expansion
depth. If you don’t need macros to expand fully, you can adjust the
Maximum recursion limit for macro expansion setting.
We’ve also enabled the new approach to detecting changes in configuration files, as well as a new way to reload project models.
Other IntelliJ Rust plugin improvements:
The new remote development workflow is now bundled into CLion and available from CLion’s Welcome screen. Use a powerful remote machine to execute all IDE operations and to build, run, and debug code – all while running the IDE on a local thin client.
Cloud dev environments featured in Space can now be used with CLion to speed-up onboarding, get a ready-to-use IDE in seconds, and manage your development resources efficiently. Learn more about Space dev environments.
CMake is a first-class citizen project model in CLion. Version 2022.1 addressed inconsistencies and lack of configuration abilities in the core areas of CMake support – CMake presets and CLion CMake profiles.
CLion now automatically creates CMake Profiles for configure presets (it was only available for build presets before). The change makes the configuration process easier and allows the removal of redundant build presets.
CLion now also works with the
--preset argument passed to the
cmake command. The data from the preset is loaded into build type,
toolchain, and build directory settings.
When the parallel reload of CMake profiles is not possible, CLion can now reload them sequentially. You can enable this behavior in Settings | Advanced Settings | CMake.
CMake generators are now easier to configure in CLion with the new and updated options:
In CLion, you can now visually inspect why it takes a long time to reload your CMake project. Starting with CMake 3.18, the new tracing can be enabled in the CMake settings. CLion will help you run the tracing and visualize the results. Learn more.
CMake scripts are now formatted more accurately:
if() .. endif(),
endwhile()are aligned correctly.
The CUDA-GDB debugger can now be used in CLion. To make it work, you’ll need to specify the cuda-gdb binary in the debugger setting of your current toolchain, and use the following compiler option:
add_compile_options(-G) to add CUDA debug symbols.
In the layout settings of the debugger tool window there are two new options available:
The option to show both decimal and hex values in the debugger now works for LLDB on Windows (Settings | Build, Execution, Deployment | Debugger | Data Views | C/C++ | Show integers as hex values and Display alongside the original value).
The Embedded GDB Server configuration can now reset the device at different stages:
Macros now work in Embedded GDB Server configuration fields.
The FreeRTOS GCC/Posix port is now supported and enables FreeRTOS debugging on Linux.
With code analysis being a key part of the IDE, we’ve been working to make it more accurate and easier to configure, and to make its notifications more informative.
Intention action suggestions are available via
Alt+Enter (alternatively, click the bulb icon). In the suggestions list,
now you can also see a preview of the result of the selected action. The preview is
available for De Morgan's laws, invert if condition, merge if-else, merge nested if,
Clang-Tidy, MISRA, Clazy, split into declaration and assignment, split into separate
declarations, and a few other actions.
Clang-Tidy and MISRA settings in Settings | Editor | Inspections | C/C++ | Static Analysis Tools were reworked to make the checks configuration process easier. A new visual representation includes a tree with all the checks. Speed search helps you find the required checks quicker – just start typing the name you are looking for when the dialog is in focus.
For Clang-Tidy, the dialog also links to LLVM documentation to help you learn about the checks in more detail.
The accuracy of the code analysis engine in CLion was increased by addressing a selection of issues, for example:
Parameter and type hints in CLion are now more informative and accurate for modern C++ code.
CLion now displays a user-friendly
wstring alias as a type hint for the
CLion now displays an accurate type hint for dependent types.
CLion 2022.1 added parameter info for struct literals and initializer list,
as well as made parameter hints more informative for the
Hints for array indices can now be disabled if you don’t need them.
New formatter options for structured bindings were added to Spaces and Wrapping and Braces sections.
Small but helpful UX improvements were introduced to make everyday IDE actions more convenient and powerful.
When creating a new C++ class, you can now specify the namespace where you’d like the new class to be located. You can write in any existing or nonexistent namespace (which will be created along with the new class), a nested namespace, or even an anonymous (unnamed) namespace if you enter a blank space in this field.
In the Structure view, elements can now be grouped by the qualified name. Select between grouped view or plain view with a fully qualified name included in each element name.
A new stub project generator for Rust projects will help you even if you don’t have the Rust plugin installed. It will help you install the plugin and navigate you through project creation.
In CLion, a toolchain is a set of all the necessary tools required for building and running your application. CLion v2021.3 makes toolchains more flexible, easier to configure and customize.
Docker containers are one of the most popular and easiest ways to set up an environment and start working with it. Instead of using Remote toolchain for Docker in CLion, you can now use the native Docker toolchain. It avoids redundant source code synchronization, as the project folder is simply mounted to the container.
CLion also bundles the Docker plugin, which brings the Services tool window and many docker-specific actions to the IDE.
Suppose you are using a custom compiler or a compiler not yet known to CLion natively, which is often the case in embedded development. There is now a way to describe all the necessary information about the compiler to CLion and work with it as if it were natively supported.
Use Settings | Build, Execution, Deployment | Toolchains | Custom Defined Compiler to enable it and provide the *.yaml file that contains your custom compiler definition. Check out the sample configs prepared by the CLion team for you.
In some cases the environment in which the compiler runs is initialized via script. It can initialize compiler environmental variables, customize the PATH variable, and more.
Use Settings | Build, Execution, Deployment | Toolchains and select Add environment | From file in CLion to source such a script for the toolchain you are using.
CLion now bundles the MinGW toolchain on Windows for quick setup, which you can rely on if you don’t have any other options installed on your machine. The exact version bundled is MinGW-w64 9.0 with
languages=c,c++, posix threads, and
Another improvement for MinGW users is a bundled 64 bit GDB v10.2 with Python support.
A new System toolchain on Windows, similar to the same toolchain type on Linux and macOS, allows configuring CMake, compiler, and debugger executables without selecting a predefined environment (like MinGW, Cygwin, WSL, or Visual Studio). This might be used for the ARM toolchain or other embedded toolchains on Windows.
A new UI for setting the CMake generator was added to the CMake Profile settings page (Settings | Build, Execution, Deployment | CMake). Users can use the default value for the toolchain selected or set any generator from the predefined list.
When the UI field is used, CMake options on the same page are updated automatically and vice versa.
Ninja is one of the most popular and effective CMake generators currently used. CLion 2021.3 comes with Ninja v1.10.2 bundled.
For local toolchains (i.e. excluding Remote, Docker, WSL) and CMake v3.20 and higher, Ninja is now the default generator for newly created projects or projects opened in CLion for the first time.
CLion now bundles CMake 3.21.1. CMake File API is used by default to query project information in CLion for CMake v3.20 and higher. Learn more.
CLion now supports CMake Presets v3.
Use the new Build directory option in Settings | Build, Execution, Deployment | Makefile to configure the directory where all make tasks are executed when the Makefile project is loaded in CLion. The configured directory is passed via
-C option to the make call. Folders like autom4te.cache in the build directory are marked by CLion as excluded.
While it’s still possible to use the Gradle project model for C++ projects in CLion, both Gradle and Gradle Native plugins in CLion are now unbundled. You can install them via Settings | Plugins.
Heavily templated standard library types, or types with global and obvious namespace specifiers, can produce long entries in the variables view during debugging.
To improve the debugging experience, CLion now performs some additional processing to render types in the variables view in a more readable and friendlier way:
In the frames view in the debugger, in addition to type rendering improvements, CLion now improves functions presentation:
A new View as Array… action is now available for any pointer variable and adds a watchpoint that renders a pointer value as array. The action is available in the context menu in the variables view. All you need to do is specify the size of the array.
To control the presentation of the types, variables, and frames in the debugger, use the new settings in Settings | Build, Execution, Deployment | Debugger | Data Views | C/C++ (or just Data Views, without the separate C/C++ section if all other languages debuggers are disabled for you in CLion).
Alternatively, you can control the presentation from the context menu right in the Debug tool window.
As part of the ongoing debugger UI redesign, Evaluate expression is now integrated right in the Debug tool window. This makes it more discoverable and easy to use.
When debugging multithreaded applications, you have to track multiple threads at the same time. The new Parallel Stacks view is implemented as a separate tab in the Debug tool window and shows thread call stack information for all the threads. It allows checking the call paths and execution points of all running threads.
Hex view for numeric variables was improved and is no longer an experimental feature in CLion. Enable it in Settings | Build, Execution, Deployment | Debugger | Data Views | C/C++ or in the context menu in the variables view.
CLion 2021.3 comes with bundled LLDB v13.
FreeRTOS thread view was expanded by adding objects and heap views:
Zephyr RTOS is now supported. To enable the tasks view, similar to the one available for FreeRTOS, use Settings | Build, Execution, Deployment | Embedded Development | RTOS Integration and select Zephyr there.
CLion 2021.3 adds type hints for deduced types to increase code readability. The new hints help with types for auto variables, in structured bindings, and for lambda return types.
You can disable or enable specific type hints in Settings | Editor | Inlay Hints | C/C++ or right from the hint’s context menu.
If the type hint includes the template instantiation, the template arguments can be collapsed by simply clicking on the angle brackets. Also, Ctrl+Click allows you to navigate to the declaration of the type you clicked on.
When exploring the structure of the file in the Structure tool window (Alt+7) or in the Structure pop-up (Ctrl+F12), you can distinguish functions with the same names more easily, as CLion now shows qualified names for the member functions there.
LLVM tools in CLion were upgraded to v14.0.0. This improves the accuracy of the Clangd-based language engine and updates bundled Clang-Tidy and ClangFormat executables. For Clang-Tidy, this also means there are a few new checks you’ll be notified about when CLion is first launched after the update.
New MISRA checks were added to CLion’s built-in analyzer:
The full list of MISRA C 2012 and MISRA C++ 2008 checks available in CLion can be found here.
CLion’s data flow analysis now treats different calls differently, and so has become more accurate. This specifically means that:
CLion’s lifetime analysis (based on Herb Sutter’s Lifetime Safety proposal) was enhanced and it can now capture cases like dangling iterator and modified owner (as owners passed by non-const reference are assumed to be modified).
Sometimes, you may have several commits that are ready to ship while others are still a work in progress. In such cases, you may want to push only the ones you are confident about. The new Push All up to Here action allows you to push commits up to the one you have selected in the Log tab of the Git tool window.
<>for header files belonging to the project. This default behavior can be changed by turning off Settings | Editor | General | Auto Import | C/C++ | Auto import local files with quotes.