What′s New in ReSharper C++

ReSharper C++ 2018.2 made big strides in deepening its understanding of the C++ language. The highlight is the long-awaited support for C++/CLI, but many important features from C++17 and even the upcoming C++20 have also been implemented. Code analysis is enhanced with spell-checking inspections powered by the newly bundled ReSpeller plugin, as well as formatting inspections which help you maintain a consistent code style.

Free 30-day trial

ReSharper C++ 2018.2


Initial C++/CLI support Ultimate

C++/CLI is a set of C++ language extensions by Microsoft for easy interoperability between managed and native code. With extensive support for both managed languages and C++, it is only natural for ReSharper to offer help with writing code in C++/CLI too.

However, with so many syntactic additions and peculiar changes to the C++ language semantics, handling C++/CLI is no easy task. But now the wait is over — ReSharper C++ 2018.2 makes C++/CLI support public, with many major features (including code inspections, typing assistance, formatting, and code completion) updated to support this language dialect.

Please remember that we are still working on improving C++/CLI support, and cross-language navigation and refactorings are a work in progress. As we move to expand our coverage we would love to hear your feedback on what is missing and what you feel we should concentrate on.

C++/CLI support requires a ReSharper Ultimate subscription and the ReSharper product to be enabled. To learn more, see C++/CLI support comes to ReSharper C++.

C++17 features

C++17 features

Another area that we’ve been putting a lot of effort into is our ongoing work on support for C++17. ReSharper C++ 2018.2 adds understanding of the following new features:

  • Class template argument deduction and user-defined deduction guides.
  • Fold expressions.
  • Auto non-type template parameters.
  • Pack expansions in using declarations.
  • Using declarations with multiple declarators.
  • Guaranteed copy elision.
  • Aggregates with base classes.
  • std::is_aggregate type trait support.
  • __has_include preprocessor macro.

All in all, these updates mean that most of the major C++17 features are now supported by ReSharper C++, with the two biggest omissions being hexadecimal floating point literals and noexcept as a part of the function type.

C++20 features

C++20 features

The C++20 standard is already shaping up and its features are becoming available in major compilers. Keeping up with the evolution of the language, ReSharper C++ now supports several features from the upcoming standard:

  • Coroutines (as specified in the n4760 Coroutines TS draft).
  • Designated initialization.
  • Range-based for statements with initializer.
  • Feature test macros.
  • Default member initializers for bit-fields
Integrated spell checking

Integrated spell checking with ReSpeller

ReSharper C++ 2018.2 provides spell-checking functionality out of the box, thanks to the newly bundled ReSpeller extension which has also been updated to support the C++ language. Just like with code analysis, ReSpeller scans for spelling mistakes and typos in identifiers, comments, and string literals, and provides quick-fixes to resolve these problems.

When you encounter a spelling mistake, you can invoke the Alt+Enter menu and ReSpeller will provide several options to fix the problem: we can either fix the typo or add this word to ReSpeller's dictionary. By default, the spell checker comes with a built-in dictionary for English (United States), but dictionaries for other languages can be easily added too.

For instructions on adding a new dictionary and more info about ReSpeller, see Integrated spell checking with ReSpeller in ReSharper and Rider.

Formatting inspections

Formatting inspections

Every now and then, you want to be notified directly in the code when you are not following formatting rules. With this in mind, ReSharper's code formatting engine introduces inspections and quick-fixes for formatter-related problems: inconsistent indenting, line breaks, spaces, and blank lines can now be observed and fixed directly in the code editor.

By default, formatting inspections are disabled so as not to bother anyone who doesn't care about formatting during typing. Go to ReSharper | Options | Code Inspection | Inspection Severity | C++ | Formatting to see all the available inspections and select severity levels for those of them that you wish to be notified of.

To learn more, see Maintaining consistent code style with formatting inspections.

Param info

Other changes

As usual, ReSharper C++ 2018.2 comes with many smaller improvements in different areas:

  • When performing size and alignment calculations, the code analysis engine takes into account bit-field sizes, alignas specifiers, and __decltype(align) attributes.
  • Parameter Info provides details about members of the aggregate class when performing aggregate initialization.
  • Comments in a code file to override formatter settings can be generated directly from the Configure Format dialog.
  • Range-based for statements provide references over the colon for easy navigation to the begin() and end() functions used by the loop.
  • Separate color settings for static class fields and static member functions were added.
  • Expected failures specification is supported in Boost.Test unit tests.
  • A lot of performance fixes in different areas of ReSharper were made, from speeding up ClangFormat support to decreasing solution loading time. More detailed information is available in the performance blog post series dedicated to the ReSharper 2018.2 release.
Free 30-day trial

ReSharper C++ 2018.1

Debug Step Filters

Debug Step Filters

Step Filters is the latest addition to the host of features provided by ReSharper C++ for debugging. When you invoke Step Into, the Visual Studio debugger will normally step into all the functions that are called from the current statement. However, some of the functions are either trivial or so well tested, that you don’t want to step into them. This is where Step Filters comes in: with this feature you can specify functions that should always be stepped over by the debugger.

ReSharper C++ comes with a predefined collection of step filters for the standard library, but you can always add new ones:

  • You can inspect, configure, disable or enable back step filters on the Tools | Debugging | C++ options page, which has a list of all the available step filters.
  • When you step into a function and decide that you want to step over it in the future, you can use a context action to quickly add this function to the list of step filters. For template functions, there are separate context actions to add either only the current instantiation of the function or all its instantiations.

To learn more, see Step Filters in ReSharper C++.

Includes Analyzer

Includes Analyzer

Compilation times are one of the biggest problems in large real-world C++ projects. ReSharper C++ 2018.1 introduces the Includes Analyzer, a new code inspection tool which helps you gauge which header files in your project contribute the most in terms of lines of code to the total compilation workload. To use it, invoke one of the ReSharper | Inspect | Analyze Includes in … actions or select Analyze Includes from the context menu in the Solution Explorer. ReSharper C++ will analyze the files in the given scope and give a report in a dedicated tool window.

The report lists files sorted by the number of lines of code they contribute together with their transitively included files. You can then dig into dependencies between the files either with the Includees tree view where child nodes correspond to the files that include the file in the parent node, or the Includers tree view where child nodes are the included files. Using these two views, you should be able to pinpoint the header files that contribute the most and then try to get rid of any unnecessary #include directives.

Navigation improvements

Navigation improvements

The Go to File Member dialog has been redesigned. Class members are now grouped by their containing class in the results list. Moreover, with no search, active file members are sorted in the order of their declarations, and the scrolling list with the results accommodates more items. Together these changes improve the usability of the dialog by providing clearer insight into the structure of the current file.

In all Go to dialogs and several other places ReSharper C++ now attempts to shorten symbol names that are excessively long by cutting out the function and template parameters.

When you perform a search using the Recent Files dialog, Go to File search results are also appended to the results list after the Recent File items.

Finally, the option to remember the last search in the Search Everywhere dialog is now on by default. You can revert to the old behavior through the Environment | Search & Navigation | Remember last search setting.

Command-line code cleanup

Command-line code cleanup

ReSharper Command Line Tools, a free standalone collection of tools that can be used from the command line or as a part of the continuous integration process, now lets you perform code cleanup in C++ projects. Run cleanupcode.x86.exe on your solution, and it will automatically reformat your code, remove common redundancies, apply Clang-Tidy fix-its and common code style fixes. This instantly eliminates code style violations in a project or a solution, and ensures a uniform code base.

In related news, bogus errors which were output by the InspectCode tool on x64 projects were fixed in this release. In addition, TeamCity 2018.1 is able to run InspectCode on C++ projects (see TW-48978 for details).

To learn more, see Code Cleanup with the ReSharper Command Line Tools.

Code inspections

Code inspections

ReSharper C++ adds the following new built-in inspections:

  • New inspection (with a corresponding fix and a code cleanup item) that suggests replacing if statements with if constexpr statements when the condition is a compile-time constant expression.
  • A set of inspections to diagnose usages of deleted functions.
  • Control flow and usage checking inspections have been updated to work inside lambda bodies.
More ways to configure inspection severities

More ways to configure inspection severities

In ReSharper С++ 2018.1, .editorconfig files can now be used to set inspection severities for any scope: the entire solution, a project, or even a specific file. Besides this, inspection severity settings can be read from the project’s DotSettings file. It means that different projects can have different sets of enabled/disabled inspections or different inspection severities.

Check the Read settings from EditorConfig and project settings option on the Code Inspection | Settings | General options page to enable this feature.

To learn more, see Configuring inspection severities with EditorConfig.

Clang-Tidy integration updates

Clang-Tidy integration updates

Clang-Tidy integration has received a few enhancements:

  • Bundled Clang-Tidy has been updated to version 6.0, which brings several new checks.
  • A new inspection action lets you disable a specific Clang-Tidy check in the current line by its name.
  • When the Clang-Tidy executable crashes, no system error dialogs will be shown from now on.
Other improvements

Other improvements

Other changes to ReSharper C++ include the following:

  • The #include_next preprocessor directive is now supported, for better compatibility with compilers that implement this GNU extension.
  • Typing assistance in C++ files automatically removes trailing whitespaces on Enter in order to keep your code clean of redundant whitespaces.
  • If you select an expression and open the Quick Documentation window, it will show various information about the selected expression, such as its type, value, and value category.
  • The new Tools | Unit Testing | C++ Tests | Use command-line arguments … setting controls whether ReSharper C++ should use the value of the Debugging | Local Windows Debugger | Command Arguments project property when running unit tests.
  • Performance of the completion pop-up has been improved.

ReSharper C++ 2017.3

Debugger features

Debugger features

ReSharper С++ 2017.3 brings the debugger into the editor: local variables, function parameters, current line expressions and function return values are now displayed inline right next to the corresponding code. In addition, ReSharper C++ comes with the new Go to Breakpoint action (Ctrl+Alt+F9) and the R# Breakpoints tool window for quick navigation between breakpoints in the solution, as well as the ability to create breakpoints and tracepoints from the Find Results tool window.

ReSharper C++ also provides its own debugger DataTips with the ability to search inside them for a specific value. To access ReSharper DataTips, click the inline value display or replace Visual Studio DataTips in the Tools | Debugger ReSharper options page.

Clang-Tidy integration

Clang-Tidy integration

Clang-Tidy is a powerful open-source code analysis tool, based on the popular clang compiler. It comes with the extensive set of code checks and accompanying fixes. ReSharper C++ 2017.3 provides seamless integration with Clang-Tidy, meaning that it simply works in the background as you edit your code, with inspection results shown on-the-fly in the code editor along with built-in inspections. ReSharper C++ also lets you apply the fixes provided by Clang-Tidy individually, as scope actions, or from Code Cleanup.

In addition to the diagnostics from Clang-Tidy checks, Clang-Tidy also issues diagnostics from the Clang Static Analyzer and warnings provided by the clang compiler itself. All of them have corresponding ReSharper inspections with configurable severity levels, which can be tuned according to your needs.

Please note that files using UTF-16 or UTF-32 encoding are not supported by Clang-Tidy at the moment.

Better C++ language understanding

Language understanding

Improving C++ understanding was a major focus of the 2017.3 release, with several C++17 and C++14 features now supported:

  • C++17 structured binding declarations.
  • C++17 inline variables.
  • C++17 constexpr if statements.
  • Deduction of return type for auto functions without trailing return type from C++14.
  • Type checking and return type deduction for lambda expressions, including support for C++14 generic lambdas.

The rest of the language-related changes include:

  • Support for include_alias pragma directives.
  • Improved handling of explicit template instantiations.
  • Support for the event handling Microsoft C++ extension.
Add missing function parameter description

Code inspections and context actions

ReSharper C++ 2017.3 comes with a set of new code inspections with accompanying fixes:

  • Binary operator with identical or equal arguments.
  • Redefinition of a default function argument from another declaration or a base function.
  • Redundant const specifier on a parameter in a function declaration.
  • Missing function parameter description in a documentation comment.
  • Redundant member initializer in a member initializer list.
  • Non-inline variable definition in a header file.
  • User-defined literal suffix that does not start with an underscore.
  • Detailed diagnostics about errors in structured binding declarations.

A couple of new context actions were also added:

  • Convert a member initializer in a member initializer list into a non-static data member initializer.
  • Switch between class and typename keywords in a type template parameter declaration.
New Code formatting features

Code formatting

Formatter can now be enabled/disabled from comments and configured using inline EditorConfig-style settings. It also adds a number of new options for more flexible formatting, including options that control:

  • Multiline code formatting:
    • Aligning code in columns for assignments, declarations, and single-line comments.
    • Outdenting commas and member access operators in chained method calls.
  • Spaces before/after commas in uniform initialization braces and before end of line comments.
Go to Declaration

Go to Declaration improvements

The Go to Declaration command is now available on dependent names inside definitions of templates. Since ReSharper C++ has no means to find the exact entity that the name refers to, instead all symbols with matching names and signatures will be found and offered as potential navigation targets.

Furthermore, Go to Declaration now lets you navigate from a function definition to a declaration with a non-matching signature, if no matching declarations are found.

The Performance Guide page

Performance Guide

ReSharper Performance Guide collects a set of Visual Studio and ReSharper settings that might affect overall performance in one place and provides a way to quickly change them. The Performance Guide page can be found in ReSharper options, under Environment | Performance Guide.

To-do items support linking to external resources

Other changes

  • Catch2, the latest version of the popular Catch unit testing framework, is supported.
  • To-do items support linking to external resources.
  • Redesigned preview pane in ReSharper tool windows and formatter options pages.
  • Find Usages window supports multi-line occurrences.
  • Search Everywhere always shows text matches, even when there are other results.

ReSharper C++ 2017.2

Code inspections in extended friend declarations

C++11 and C++17 features

ReSharper C++ 2017.2 understands C++11 extended friend declarations and finalizes support for string and floating-point user-defined literals. The ongoing work on C++17 support is also progressing: selection statements with initializer, using in attribute namespaces, and capturing *this by value are all supported now. In addition, code inspections now take C++17 [[nodiscard]] and [[maybe_unused]] attributes into account.


In an ongoing effort to improve performance, ReSharper C++ 2017.2 focuses on switching build configurations — by default, this operation now does not require reindexing of project files. In addition, Visual Studio's Lightweight Solution Load mode is supported for C++ projects starting with Visual Studio 2017 15.3. This reduces UI lags caused by reading project properties and improves memory usage.

Language understanding

Version 2017.2 improves language support in a lot of different ways:

  • Find usages and Rename can handle user-defined literals.
  • Declaration search works inside bodies of macro definitions.
  • Anonymous nested structures are supported in C code.
  • Expression SFINAE support gets better.
  • Completion lists inside class bodies include virtual methods from base classes that can be overridden.
  • More standard type traits are supported, including all traits with names prefixed by is_trivially.
Line wrapping settings

Code formatting

The code formatting engine receives two major enhancements:

  • ClangFormat configuration files are supported and get automatically used as a source of formatting style settings.
  • Long lines can be optionally wrapped, with a number of new settings for the wrapping behavior.

A number of new formatting options were added, in particular options that control:

  • Line breaks after template headers and function return types;
  • Indentation of parentheses in function declarations, method calls and if/while/for statements.
Naming inspections in C++

Code inspections and quick-fixes

ReSharper C++ 2017.2 adds several new code inspections:

  • Inconsistent Naming detects violations of naming rules in your code. Additionally, the Naming Style options page was updated to allow adding custom naming rules, which let you configure this inspection.
  • Local variable may be const highlights local variables that can be made immutable.
  • Unused entity inspections extend their scope from local variables and function parameters to also include global variables/classes/enums that have internal linkage or are members of an anonymous namespace.

A number of new quick-fixes for existing inspections were also introduced, including Add std::move when cannot bind rvalue reference to lvalue, Return unused expression, and Add an #ifndef/#define/#endif include guard.

Navigate to File Nearby

Navigation improvements

  • Navigate to file nearby displays project structure around the current file.
  • Go to Text is integrated into Search Everywhere.
  • Go to Everything searches now return results even when word order inside a CamelCased identifier is incorrect.
  • Exact search supports adding quotes and using wildcards inside quotes to enforce a more precise match.

ReSharper C++ 2017.1

Visual Studio 2017 RTM

Visual Studio 2017 RTM support

Completing the work started in the 2016.3 release, ReSharper C++ improves compatibility with the latest Visual Studio release. It supports Open Folder and CMake projects, as well as the Faster Project Load Visual Studio setting.

Join declaration and assignment quick-fix

Inspections and code cleanup enhancements

  • The Update file header cleanup task and a set of tasks to fix common code issues are added
  • Control flow inspections are updated to handle class fields in addition to local variables and function parameters
  • The inspection Declaration and assignment can be joined is implemented, together with an accompanying quick-fix
  • In order to improve inspection results, ReSharper C++ understands several custom C++ 11 attributes that can be used to mark printf-style functions, functions with side effects, and guard classes for which the Unused variable highlighting should be suppressed
Postfix templates settings page

Postfix templates

The set of postfix templates is extended with beg..end, new, var, const_cast, dynamic_cast, reinterpret_cast, static_cast, make_shared, and make_unique.

You can configure the availability of C++ postfix templates and some other settings on a Postfix templates page of the ReSharper options.

Indenting of preprocessor directives

Code formatting

  • ReSharper C++ understands formatting rules defined in the EditorConfig files
  • Indent size and style can be auto-detected
  • Indenting of preprocessor directives is now supported
  • New formatter options: Indent namespace members, Space after parentheses in cast expressions and Break line in simple 'case' statement

Performance improvements

ReSharper C++ significantly lowers its memory usage, including both memory footprint after indexing and memory traffic during the indexing, thus reducing lags caused by GC pauses and overall indexing time. Moreover, the reindexing process should trigger less often during the normal workflow, as ReSharper C++ will not, by default, invalidate includers after preprocessing directives change in an included file. A number of issues that previously caused excessive memory usage due to the background editor and Find Results window tabs have also been resolved

Other improvements

Other improvements in ReSharper C++ 2017.1 include:

  • The Find Results window gets a new option to group and filter results by kind of usage
  • Go to Everything and Go to Text popups support inline commands for advanced filtering of search results
  • Context menu on the file status indicator provides quick access to a number of code inspections and commands

ReSharper C++ 2016.3

Introduce or inline a typedef with ReSharper C++

Typedef refactorings

The Introduce typedef refactoring allows you to quickly create a typedef for the selected data type and replace this data type and all its occurrences with the newly created typedef.

The Inline typedef refactoring does the inverse: it replaces an existing typedef with the actual data type.

Postfix templates for C++

Postfix completion

Postfix code completion allows you to focus on your data, rather than the syntax. When you type a dot (.) or an arrow (->) after an expression, ReSharper C++ will suggest free functions that would accept that expression as the first parameter. If you accept the suggestion, ReSharper C++ rewrites your code so that the expression is passed as the first argument.

ReSharper C++ gets some postfix template goodness as well. Postfix templates can help you transform expressions without the need to go back in the code. You can now quickly wrap an expression with one of the following templates: if, else, while, do, return, switch and foreach.

Support for Catch unit testing framework

Catch support

In addition to Boost.Test and Google Test frameworks, unit testing assistance is now available for the Catch C++ test framework. Therefore, you can now use ReSharper C++ unit test runner to discover, run, and debug Catch tests in Visual Studio.

Initial support for Visual Studio 2017 RC

Visual Studio 2017 RC initial support

ReSharper C++ 2016.3 can be installed into Visual Studio 2017 RC just like all other ReSharper Ultimate 2016.3 tools.

Please note that in order to work with ReSharper C++, you should set Enable Faster Project Load to false under Tools | Options | Text Editor | C/C++ | Experimental. We plan to support this new project load mode in further updates.

Support for C# style XML documentation

Tooltips and XML documentation

ReSharper C++ can now display rich, syntax highlighted tooltips for C++ code elements. The tooltips will display function and variable types, as well as documentation. In addition, \tparam references in Doxygen comments are now properly resolved and can be renamed.

C#-style XML documentation comments are also sometimes used for C++ symbols . With ReSharper C++ 2016.3 they are correctly displayed in the Quick Documentation pop-up (Ctrl+Shift+F1) and in the quick info tooltip.

C++ code analysis from the command line

Starting from version 2016.3, ReSharper C++ code inspections become available via InspectCode, a free command line tool that allows running ReSharper inspections outside of Visual Studio.

To use InspectCode, please download and unzip the command line tools package and run InspectCode.exe with your solution file as a parameter. To learn more about using InspectCode, please read this article.

Other improvements

Other improvements in ReSharper C++ 2016.3 include:

  • Support for nested namespace definitions introduced in C++17 and a context action to use the new syntax for nested namespaces.
  • Third-party code settings page that allows to exclude files from indexing: this page allows adding files, folders and wildcards to be treated either as "skipped" or "library".
  • Support for asynchronous Find Results.
  • New options for C++ code formatter: Spaces within parentheses in cast expressions, Place enumerators on new line, Align chained method calls and Align chained binary expressions.
  • Support for Boost.Test in Boost 1.62.

ReSharper C++ 2016.2

Inline Variable refactoring in C++

Inline Variable refactoring

The mainline ReSharper's refactorings continue to make their way into ReSharper C++.

The latest update adds Inline Variable, which replaces all occurrences of a given variable or local constant with its initializer. The reverse functionality is provided by Introduce Variable.

Quick Documentation pop-up

Quick Documentation pop-up

ReSharper C++ 2016.2 adds the Quick Documentation pop-up to display documentation based on Doxygen comment blocks without having to navigate to a symbol's definition: just hit Ctrl+Shift+F1 in the default keymap.

Even if there is no Doxygen documentation available for a symbol, Quick Documentation will show the symbol's signature.

Generating stubs for C++ documentation comments

Generate and maintain doc comments

In a related change, you can now generate documentation comments for C++ declarators, classes and macro definitions via Alt+Enter. If you're not a fan of the comment stub that ReSharper C++ uses by default, you can customize it by editing the doc live template.

Speaking of documentation, ReSharper C++ can now complete, find usages and rename symbols in Doxygen comments.

Quick-fix to generate a missing switch default case

New code inspections and quick-fixes

ReSharper C++ 2016 further extends its assortment of code inspections and automated fixes.

For example, there's a new code inspection that warns you about missing include guards in your header files. An associated quick-fix helps automatically add a #pragma once directive.

Another new inspection detects a missing default case in a switch statement and suggests a quick-fix to add one.

In other news, ReSharper 2016 can now warn you about usages of classes and functions marked as [[deprecated]] or __declspec(deprecated).

Code style settings for default pointer initializer

More code style preferences

ReSharper C++ 2016.2 introduces code style preferences for default pointer initializer. You can specify 0, nullptr or NULL as the preferred initializer style, and ReSharper C++ will respect your choice when it generates new initializers for you. A similar code style preference is added for #include directives.

The code formatter is also evolving with new options for single-line functions and lambdas, blank lines around single-line function definitions, space between closing angle brackets in template arguments, and more ways to tune formatting to your or your team's preferences.

Auto-completion for C++ symbols not included in current file

Auto-completion adds includes

Automatic code completion in ReSharper C++ 2016.2 learns to suggest symbols that are not yet included in the current file. When you select a symbol like this in the completion list, the corresponding #include directive is added automatically.

Auto-highlighting for exit points

Auto-highlighting exit points

When you put the caret on one of exit points from a function, loop or a switch statement (return, throw, break etc.), ReSharper C++ will now automatically highlight all other exits.