What's New in CLion

CLion 2017.2 update is focused on C++ correctness and performance improvements. It also comes with Clang-Tidy checks and quick-fixes built into the editor to help you ensure code quality. Various VCS and UI improvements make your experience with the IDE smoother and more productive.

2017.2 Jul 19

Clang-Tidy

Clang-Tidy: modernize

Clang-Tidy on board

Clang-Tidy is a powerful code analysis tool that provides dozens of valuable checks and quick-fixes. Now you can benefit from it in CLion – it works as you type, and shows messages the same way as CLion’s own built-in code inspections. Clang-tidy quick-fixes are similarly available via Alt+Enter.

Clang-Tidy: settings

Configure the checks you need

Make the IDE run only the checks you really need. To configure this easily, go to C/C++ code inspections settings Settings/Preferences | Editor | Inspections | C/C++ | General | Clang-Tidy). Clang-Tidy command line format is used in the text field. The default configuration can be found here.

Cpp Core Guidelines

C++ Core Guidelines, and more

Clang-Tidy incorporates lots of valuable checks. Among them are C++ Core Guidelines checks (use -*,cppcoreguidelines-* to run only these), modernize C++ code checks (-*,modernize-*), and many others.

Add your own checks

Clang-Tidy is easily extendable, with a convenient API for writing new checks. Add your custom checks and get them immediately in CLion. JetBrain's fork of Clang-Tidy should be used (until our patches are accepted to LLVM master).

C++ Support

Code analysis correctness

Focusing on correctness, CLion 2017.2 improves its C++ code analysis across the board. For example:

  • Fixes for incorrect code analysis in cases when std::enable_if is used
  • Fixes for the issues with resolving STL containers with nested template type for GCC5/6
  • Proper support for va_* macros was added
  • Correct handling of functions that take parameter pack arguments and non-template arguments
Unused var quick-fix

Unused variable quick-fix

Even when variable is unused, constructor might still have some side effects. A new quick-fix was added to preserve non-trivial constructor call on unused variable.

C++ type casts

C++ cast operators

CLion’s intentions and quick-fixes in C++ code suggest C++ type casts (static_cast, dynamic_cast, reinterpret_cast, const_cast) instead of C-style casts.

Learn more

C++17 in the New Project wizard

C++17 in the New Project wizard

C++17 is now available in the list of standards in the New Project wizard. CLion will automatically add set(CMAKE_CXX_STANDARD 17) to the CMakeLists.txt generated for new projects.

PCH for Microsoft Visual C++ compiler

Precompiled headers are now supported for MSVC as well. Learn more

Debug

Force Step Into

Force Step Into

The Disassembly view is shown in CLion when sources are not available when debugging with GDB. To get into disassembly code, now you need to use a special action, Force Step Into (Shift+Alt+F7). The usual Step Into (F7) will simply skip all frames without sources.

Long arrays

Inspecting big arrays

To reduce timeouts during array evaluation while debugging, CLion uses a limit of 50 array elements shown by default. If you need elements with big indexes and clicking expand is not an option, then simply increase the value cidr.debugger.value.maxChildren in the Registry.

Keep in mind that this may lead to increased timeouts as well.

GDB driver fixes

CLion 2017.2 fixes several annoying issues with GDB driver:

  • Command time out when trying to attach to a non-existent local process
  • Incorrectly escaped backslashes in program arguments on Windows

Performance improvements

Indexing times were improved in some cases. And after optimizing the parsing of the compiler predefined macros in CLion, some performance improvement during the reindexing was achieved as well. Besides, in some cases it’s just about giving users more control:

Cancelable go to actions

Cancelable asynchronous Go to actions

Go to subclass and Go to overridden functions actions may take significant time as they build a list of available options to navigate to. To improve IDE performance and responsiveness, we’ve made it possible to cancel these navigation actions – simply click to the area out of the navigation popup window and it’s done!

Cancelable CMake reload

Cancelable CMake reload

To save time, it’s now possible to cancel CMake reload in order to introduce additional changes or just to postpone this time-consuming operation. To that end we’ve added a Stop button to the CMake tool window.

To distinguish cancelled and finished CMake runs, CLion now displays [Finished] in every output tab for each CMake configuration being reloaded and finished.

Find in path UI

The Find in Path popup introduced in 2017.1 has received some UI enhancements.

Find in Path: left gutter

Left gutter in preview

The Preview panel now has a full-featured left-side gutter with navigation icons, and markers for local changes.

Find in Path: Merged results

Merged results

For your convenience, search results from the same lines are now merged together in the Preview panel.

VCS

VCS: Git Revert

Revert

Git Revert is now available in the Git Log view and works for any number of selected commits.

VCS: Reword

Reword

To change the commit message for a commit that has not been pushed yet, use the new Reword action.

Commit messages settings

Commit Dialog settings

To keep the commit messages easy to read and expressive, take care of their formatting. Updated settings allow you to control blank lines between subject and body, maximum text length, and check spelling. They are located under Version Control | Commit Dialog.

VCS: quick-fixes

Quick-fixes for commit messages

CLion now offers quick-fixes for commit messages, such as reformat or wrap lines.

Other improvements

  • CMake 3.8 is now bundled into CLion.
  • Google Test Run/Debug configurations are generated automatically for targets linked with gmock (similar to what was previously done for gtest).
  • On Windows displays, CLion gets its own scale factor and the UI is scaled accordingly.
2017.1 Mar 29

Modern C++

C++14

CLion 2017.1 delivers support for the following C++14 features:

  • auto return type,
  • generic lambdas,
  • variable templates, and
  • generalized lambda captures.

See the full list of supported features per standard in CLion’s online documentation.

C++17 support

C++17

As the C++17 standard is just around the corner and the upcoming features are being finalized, CLion starts supporting C++17 with nested namespaces.

Make auto intention

Make auto intention

For the sake of code readability and accuracy, CLion now suggests to modernize your C++ code by converting variable type to auto.

As this feature should be used carefully across your code base, it’s implemented as a non-intrusive intention. Use it as you see fit.

Code analysis

General improvements

We continue to improve CLion’s parser and code analysis to make it even more accurate:

  • Hidden functions from the base class are no longer suggested in completion
  • Fixes for various false positives, for example in case of decltype(auto) in trailing return
  • Correct calculation for value category (that fixes many false 'expression is not assignable,' 'expression must be lvalue,' and 'expression must be rvalue' warnings)

Precompiled headers

Precompiled headers

CLion now locates the precompiled headers and headers included via -include option, in order to correctly resolve symbols from such files and correctly highlight the code, navigate through it, perform code refactorings, etc.

Learn more

Disassembly view for debugger

Disassembly view

While debugging with GDB, you can now step into disassembly code when the sources are not available. Read the assembly, which is properly highlighted in the editor, and step through it to investigate the problem.

Catch

Catch

Catch is a cross-platform unit testing framework for C++ known for its easy starting process and convenient and flexible test cases. Now you can use Catch with CLion and benefit from completion and the built-in test runner.

Microsoft Visual C++ compiler

Experimental support for the Microsoft Visual C++ compiler is here. Check it out to avoid difficulties with MinGW/MinGW-w64 or Cygwin configuration, and especially if you use Microsoft Visual C++ as a compiler for your cross-platform C++ project.

MSVC

Current support covers:

  • Auto-detection and support for C++ compiler from Visual Studio 2013, 2015 and 2017
  • Support for projects using CMake with NMake generator
  • Settings to configure architecture, platform, etc.
  • Navigation through the compiler errors in the Messages tool window

To switch on the support, use clion.enable.msvc option in the Registry.

Project model improvements

Project model is now more user-friendly:

  • For existing CMake projects, the project name in CLion is taken from CMake’s PROJECT_NAME on first opening
  • Escaped symbols in CMake files are now handled correctly
  • Obsolete not-modified run configurations, and run configurations for deleted targets, are now removed automatically

Find in Path

Run a text search across the whole project or any selected scope with Find in Path, now in a compact and more convenient popup window with immediate preview.

Find in path

VCS

Make auto intention

Log Viewer

Refine your search through the Git and Mercurial logs in the Log Viewer with these new options:

  • Ability to use regular expressions
  • Ability to match / ignore case

Configure which information to display in the log viewer to make it more compact or more detailed (for example, show / hide tag names).

Branches

Branches popup

The Branches popup has been redesigned and can now mark important branches as Favorites.

This gives you the ability to filter the branches and show only favorites in the corresponding popup.

Swift

Swift

Several important enhancements were added to the Swift plugin for CLion:

  • Create new Swift projects with ease using the new project template
  • Check possible issues in your code in Swift with SourceKit inspections and intentions available in the plugin
  • When using a type which doesn't exist yet, create it from usage via Alt+Enter

Other improvements

  • Zero latency typing has proved to remove many typing lags in IntelliJ-based IDEs and is now enabled by default
  • CMake 3.7 was bundled into CLion
  • Fixes for Dvorak layout in macOS, as well as Korean, Chinese and Japanese keyboard layouts on macOS are included
  • Settings Repository plugin is finally bundled into CLion
  • Go plugin was updated and now correlates with Gogland functionality
2016.3 Nov 22

C++ support

User-defined literals

This C++11 feature brings the concept of built-in type into the language and is now supported by CLion, including correct parsing, type preview in Quick Documentation popup Ctrl+Q and Rename refactoring Shift+F6.

Read more

C++14 digit separator

CLion can now correctly parse numbers that use single-quote character as a digit separator.

Overload resolution improvements

The process of selecting the most appropriate overloaded function or operator can be tricky. As far as the IDE is concerned, selection of the correct candidate affects code navigation, parameter info view and code analysis. CLion 2016.3 handles this well and even introduces two new code inspections for such situations:

  • Ambiguous call
  • No matching function to call

Read more

Code analysis improvements

Static analysis (including DFA) in CLion helps you write beautiful and correct code. In 2016.3 we’ve reworked dozens of checks to avoid false-positives. This work includes:

  • Correct tracking of variable usages in sizeof(), cin and cases when variable is passed by reference
  • Correct handling of non-trivial destructors in the Unused variable inspection
  • Support for __builtin_unreachable and __attribute__(unused)
  • Platform-dependent code analysis
  • And more

C support

CLion 2016.3 adds support for _Generic keyword, as well as code completion for specific C11 keywords such as _Thread_local, _Alignas, _Noreturn, _Static_assert, and _Atomic.

This version also brings support for gcc atomic builtins.

CMake workflow

Select generation directory

Users can now control the CMake generation directory inside CLion – not only the build directory where the final artifacts are stored. The corresponding setting is available in Build, Execution, Deployment | CMake settings and allows in-source builds, among others.

Select configuration

To save memory and time, CLion now doesn't build all four CMake configurations by default, but allows you to create additional CMake configurations (as many as you need). Create any number of CMake configurations from scratch, or copy existing ones, with all the settings pre-filled.

Open project from existing directory

Once CMake generation is done for your project, you can now open it in CLion, saving time on project opening. CLion will reuse the generation directory content and CMakeCache.txt file.

Note: Currently this works only for Makefiles generator.

CMake output console

CMake tool window

Updated CMake tool window (View | Tool Windows | CMake) now includes CMake output logs, that can be used to track the progress and debug CMake scripts. CMake output console supports error highlighting, links to corresponding CMake files, and navigation to next/prev errors.

CMake Cache

CMakeCache file can be now updated directly in CLion’s editor. This makes it possible to introduce any change to it, including new CMake Cache variables.

Project templates

Templates for C and C++ projects

If you plan to start a project from scratch, use project templates to generate the sample project and pre-fill root CMakeLists.txt with the necessary information (like for example, language standard or library type for a library project).

Debugger

Remote debug on Windows

Remote GDB debug comes to Windows. Use your Windows machine to debug applications running on another Windows or Linux host.

Read more

Code highlighting

Semantic highlighting

Unlike the usual highlighting that picks out language keywords, types and values, semantic highlighting helps understand how data flow through the code by highlighting each variable/parameter with its own color. Switch it on in CLion in Editor | Color & Fonts | Language Defaults settings and give it a try!

Highlighting and configurations

When code depends on a set of variables and flags set in the run/build configuration, you can see the difference in the editor immediately as you switch the configuration in CLion. Resolve context is updated automatically, while manual switcher is still available as before.

Unreal Engine support

This version brings performance improvements for reopening an UE4 project that was previously indexed in CLion, along with a couple of fixes for parsing UE4 code. The above enhancements along with several plugins make the overall UE4 experience in CLion much more pleasant and convenient.

Check our tips for coding games with UE4 in CLion

Doxygen

tparam tag support

Doxygen support in CLion includes documentation comment generation for functions, classes and structures. Template parameters are now handled correctly, and a \tparam (@tparam) tag is generated for them.

Also, renaming a template parameter will update the documentation accordingly.

VCS

Undo actions

Sometimes when working with version control, you change your mind at the last moment. CLion helps you undo certain actions to avoid any harm:

  • undo the last change that you haven’t pushed yet;
  • restore a deleted local branch.

Sign-off commit

Linux kernel patches and some other projects require Git –signoff commits to be used. CLion now makes this possible to do from the commit changes dialog.

Resolve conflicts in one click

Simple conflicts can now be resolved by the IDE. If you have several nonoverlapping changes on one line, CLion will show a special resolve icon in the merge dialog. Click the icon to have the conflict resolved by the IDE.

Git remotes

Manage remotes through the VCS | Git menu. Now you can add, edit and remove remotes for every repo in the project.

Filters in Git/Mercurial log

CLion now builds an index for all commits on first-time project opening and later update it on a log refresh. This improves the performance of text, author and path filters in the Git log.

Git/Mercurial log UI changes

A new design for branches and tags in Git/Hg Log makes it cleaner and easier to use:

  • labels have moved to the right;
  • commit messages in the table are now aligned;
  • commit details have moved to the right.

UI enhancements

Find in Path

The Find in Path dialog now keeps previously used settings (scope, file name filter, context, etc.), regardless of where you call it from.

San Francisco font

On macOS, the default font in the Default and Darcula themes is now San Francisco (SF NS Text). It’s used across all the menus and tool windows.

Fira Code font

CLion 2016.3 bundles the FiraCode font, so font ligatures are now much easier to use. To set is as your editor font, select it in settings Editor | Colors & Fonts | Font.

macOS support

CLion 2016.3 includes a fix for extremely sensitive scrolling with a trackpad on macOS Sierra.

Also, the native file chooser on macOS is back.