What's New in CLion

In its third update this year, our cross-platform C/C++ IDE becomes more educated about modern C and C++ language features, takes on a more flexible and efficient approach to CMake project model, and enhances your editing and debugging experience.

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.

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:

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 builds one configuration at a time. Select between Debug, Release, RelWithDebInfo, MinSizeRel or any custom one in CMake settings.

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 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.
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.

Debugger

Remote debug on Windows

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.

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.

Doxygen support

Doxygen-styled docs viewer

If a project includes Doxygen-styled documentation, you can easily preview it in the Quick
Documentation pop-up Ctrl+Q. It includes Doxygen-styled information (parsed and formatted)
along with the type information.

Safe Rename

Rename Shift+F6 a
function or its parameters and be sure CLion will update the corresponding information in
the Doxygen comments for you.

Completion

Doxygen comments generation

Stubs for Doxygen comments can be generated automatically with CLion. If your function has
parameters, returns a value or throws an exception, type “/**”, “/*!”, “///” or “//!” and
then press Enter to generate a Doxygen stub for the function.

Code generation

Generate operators

CLion is ready to help you with boilerplate code. With version 2016.2 generate equality, relational and stream output operators in one click. Select std::tie, 'generate as
class members' and other options as necessary.

Generate definitions

A new setting called Generate in-place makes the Generate Definitions dialog more flexible.
The defaults for this setting depend on your code, and heuristics are implemented to support
the most common cases (like header-only or cpp-only classes).

Complete Statement

With the updated Complete Statement Shift+Ctrl+Enter in CLion, parentheses, braces, semicolons, quotes, etc. are inserted as necessary and the caret is moved automatically so you can start typing the next statement.

Debugger

Performance improvements

Along with plenty of correctness and ‘command timeout’ fixes in the debugger drivers (both
GDB and LLDB), this version brings changes that affect debugging startup/shutdown, stepping
with various data views, and expanding big data structures. For many of them performance has
been improved greatly.

LLDB on Linux

LLDB is now available not only on macOS, but on Linux as well. Select between the bundled GDB
or LLDB, or a custom GDB version.

Attach to local process is now possible on Linux with either LLDB or GDB.

Remote GDB debug

CLion 2016.2 supports remote debugging with GDB/gdbserver. Start the program under gdbserver
on target machine, and then connect to it from CLion running on another one (macOS or
Linux). Inspect the code using breakpoints, expression evaluation, watches and other
benefits of the IDE’s built-in debugger UI.

Watches and Variables

The Watches view has been merged with the Variables view so you no longer need to switch
between them. But if you feel more comfortable with the previous layout, feel free to switch
this mode off and keep things as they are.

CMake support

Coding assistance

Writing CMake files gets easier with code completion and navigation actions such as Go to
declaration/definition for user symbols in CMake (like functions or macros). Also, you can
now view Quick Definitions Shift+Ctrl+I for such symbols.

Rename for users symbols

In addition to coding assistance, CLion 2016.2 supports Rename refactoring Shift+F6 for user symbols
in CMake. This results in safer renaming for such symbols as CLion updates all the usages
automatically.

Safe delete

Get CMake commands updated automatically when you delete files from your project. CLion will
either remove the file reference from the command arguments, or warn you about a possibly
incorrect command after deletion.

Live templates for Boost

CLion 2016.2 adds an updated boost template, as well as a new
boost_with_libs that helps link your target with Boost libraries.

CLion environment variable

In order to detect if CMake on your project was run from CLion, and if so, set special variables/paths or execute some additional scripts of your choice, CLion 2016.2 sets an environment variable (CLION_IDE) that you can check in your CMake files.

Auto-completion for environment variables helps you type them easier.

Code style

New code style settings

With plenty of formatting settings available in CLion, you’ve always been able to flexibly
configure your preferred code style. CLion 2016.2 adds a few new settings to fine-tune
wrapping for lines after function return type, lambda capture list, and in << and >> operators.

LLVM/LLDB code styles

Predefined code styles provide you with ready-to-use code styles, or can be used as a basis
for your custom style. In the 2016.2 release, you get LLVM and
LLDB styles.

Editor background

Customize the look of your editor in CLion 2016.2 by calling Set Background Image action from Find Action Shift+Ctrl+A. Select an image, configure its settings in the dialog, and
enjoy your custom background as you code.

Tool windows

Alphabetical sorting in Structure View

Structure view Alt+7 lets you navigate across the structure of the current file. By
default, its entities are grouped by type (namespaces, structures, classes, etc.) in the
same order as the original file. CLion 2016.2 adds the option to sort them alphabetically,
which makes more sense for long files.

Inspections tool window

The updated Inspection window gives you an immediate code preview and allows you to apply a quick-fix or suppress the inspection in-place.

VCS

Unversioned files

Now it's easier than ever to remember about important files not yet under version control when committing. CLion shows them clearly in the commit dialog.

Log viewer

Working with Log viewer becomes more enjoyable thanks to these changes for Git and Mercurial:

Tooltips are shown with target commit information for arrows.

The IDE now loads the contents of the Log viewer in the background on every change
(commit, fetch, rebase, etc.), so it’s always ready when you open it.

Commit details are shown for several selected commits.

Patches

To help you work with patches more effectively, we’ve implemented a couple of useful features in CLion 2016.2:

You can now apply a patch directly from the clipboard or drag a file into the IDE.

The ‘Apply patch’ dialog provides you with a Show Diff action to check the changes over
your local version (with the ability to introduce local changes).

The IDE helps you apply patches to files that were already moved or renamed.

Case-only renames

CLion adds support for case-only renames in Git for Windows and macOS. This means that if you
only changed the case of some letter while renaming a file (or folder), such a change will be
previewed and committed successfully from the IDE.

Other improvements

Supported and bundled toolchains versions were updated:

bundled GDB version updated to 7.11;

bundled LLDB (on macOS and Linux) version updated to 3.8;

maximum supported version of MinGW-w64 is 5.* and Cygwin updated to 2.*;

bundled CMake version updated to 3.6.

CLion for Windows now bundles a customized JDK with font-rendering and focus fixes from the JetBrains team.

Quick documentation improvements

Code generation

Generate definitions

In case you have a function declaration, you can generate definition quickly with a new action - generate definitions Shift+Ctrl+D. Choose destination for the newly created definition or generate in-place if invoked inside the class.

Corresponding action is also available via intention actions list.

Generate in-place

Override/Implement now generates code in the place where the caret is positioned, asking for destination in case of multiple choices. That means if you want the function to be generated in a header file - locate the caret in that class in your header file, and if you want it in the source file - execute action there.

RTL language support

Right-to-left languages (Arabic and Hebrew) are now supported in the editor.

Files & directories under your control

Mark directory as

Independently from the CMake project structure, mark directories manually as libraries, project sources and headers or excluded directories. This will affect indexing along with code generation, refactorings, and more.