CLion 2018.1

Enhanced C++17 support, new CMake actions and a more responsive editor.
April 3, 2018
New Version

Features

WSL

  • Linux toolchain on Windows - If your project requires a Linux toolchain while being developed on Windows, you can now use Windows Subsystem for Linux (WSL) in CLion running on Windows.
  • Valgrind Memcheck on WSL - Valgrind Memcheck can detect dozens of memory errors and leaks and is now available for Windows users on WSL.

C++ support

  • C++17: If and switch with initializers - To avoid polluting an ambient scope or creating an artificial scope for initializers in if and switch operators, C++17 suggests adding an initializer to if and switch conditions. CLion now parses and resolves such statements correctly.
  • C++17: Structured bindings - C++17 introduced structured binding – a convenient and compact way of binding a list of identifiers to a set of objects. CLion’s C++ language engine now supports this feature and ensues accurate code analysis for it.
  • Ternary operator - The ternary operator is now handled correctly in CLion’s code analysis. This means many false warnings and errors are no longer thrown, such as:
  • Red code in the ternary + new operator
  • False positive if std::out is used in the ternary operator
  • Incorrect resolve when initializing a reference from a ternary operator
  • Rename and Change Signature for hierarchies - Refactoring hierarchies can be tricky, especially if you introduce a change in a derived function. To make it reliable we made sure that the Rename and Change Signature refactorings update functions in all inheritance branches, including sibling functions.

Clang-Tidy

  • Clang-Tidy options and configs - Now you can provide options to some Clang-Tidy checks (e.g. modernize-use-nullptr) in CLion, under Settings - Editor - Inspections - C/C++ - General - Clang-Tidy.

Editor

  • Code folding of the control statements - Now you can collapse/expand control statements (like if/else, do/while, for, or switch) with a code block that’s longer than one line, or with a code block inside braces. Just use Shift+Ctrl+Period / Ctrl+= You can also hover the mouse over the folded block to preview the content.
  • Message toolwindow: new settings - With v2018.1, you can decide if build output is always necessary (and thus should be visible) or it’s only needed if some warnings or errors appear. Look in the Messages tool window settings for these options:
    • Always Show on Build (Default)
    • Auto-Hide and Show on Warning/Error
  • Breadcrumbs for C and C++ - Keep track of your location in C and C++ code with the breadcrumbs – small markers at the bottom of the editor that help you navigate around your code. Right now CLion shows namespaces, classes, structures, functions, and lambdas there.
  • Unwrap/remove code blocks - To accurately and safely remove enclosing parts in complicated code with lots of nested statements, use Unwrap/Remove… action (Ctrl+Shift+Delete). It suggests the options depending on where your caret is and is capable of unwrapping if, else, for, while, do..while and for control statements.

CMake

  • CMake Install - If you have any CMake install targets in your project, you can call Install from the CLion’s Run menu now. The cmake install command will be executed.
  • Open single file and non-CMake projects - While CLion still requires a CMake project to provide smart IDE features, you can now open a single file or folder in CLion which don’t have to be connected to any CMake project.
  • CMakeLists.txt file template - Create new file (Alt+Insert) now provides an option to create a CMakeLists.txt file. The content of the generated file is defined by the template in Settings | Editor | File and Code Templates, so you can customize it based on your project’s or team’s needs.

Project scopes

  • Predefined and custom scopes - CLion 2018.1 brings several predefined scopes which can help overview your project from different angles, like Project Source Files, Project Non-Source Files, and Changed files.
  • Project view - By default, Project View opens the Project, which includes all project files including the generated folder (like cmake-build-debug) and other excluded folders. Later, you can select between other predefined or custom scopes.
  • Find in Path - To narrow down your search and thus make it quicker and more efficient, use scopes in the Find in Path dialog. All custom scopes created earlier are available in the list.

VCS: Partial Git commits

  • Select code chunks to commit - Want to commit only the selected changes from files and leave others for later? Partial Git commits (git add -p) can help here, and now there is support for them provided by CLion.
  • Move a change to the changelist - While editing a file, you can see change markers in the left gutter. These not only let you overview the change and roll it back, but also move it to any existing changelist or create a new one and add the current code chunk to it.

More languages

  • Objective-C / Objective-C++ support - Work with files in Objective-C / Objective-C++ added to your CMake project and benefit from the following features (courtesy of AppCode) bundled into CLion:
    • Language syntax support
    • Objective-C inspections (except for the clang analyzer set)
    • Key-value coding support
    • Live and file templates
    • Code style/color schemes
  • Fortran and Rust plugins - Fortran plugin comes with FORTRAN 77 / 90 / 95 / 2003 and 2008 support. The capabilities include smart editor, navigation actions, code analysis and debugger. Rust plugin comes with:
    • the Cargo build system on board,
    • updates to CLion’s New Project wizard
    • and a debugger.

Other improvements

  • Performance improvements: Important changes were introduced to make the editor more responsive. Incremental highlighting was implemented.
  • MSVC by default: No need to turn on Microsoft Visual C++ compiler support in Registry – now it works by default.
  • Color scheme improvements: CLion now bundles Monokai and GitHub schemes, and comes with lots of fixes to the existing schemes.
Enhanced C++17 support

CLion

A cross-platform IDE for C and C++.

CLion is also available in:

Got a Question?

Live Chat with our JetBrains licensing specialists now.