News Releases

ReSharper C++ 2023.1: Call Tracking, Macro Expansion Preview, and Support for C++23 Features

We’ve just released ReSharper C++ 2023.1!

This update brings support for new C++20 and C++23 features as well as improvements for C++20 modules, Call tracking, macro substitution previews, context actions for refactorings, and file templates for Unreal Engine tests. To learn about all of the improvements in this release, check out our What’s New page.

ReSharper C++ 2023.1

Update to this version, or start a free 30-day trial today! The brand-new build is available on our website, and all our tools for Visual Studio can be downloaded via the Toolbox App.

DOWNLOAD RESHARPER C++

Without further ado, let’s take a look at the key features in the new version:

Call tracking

ReSharper’s Call tracking has finally come to ReSharper C++! You can now view and navigate through call chains in the hierarchy of incoming calls. Just place the caret at any function and select Inspect | Incoming calls from the context menu or press Ctrl+Shift+Alt+A to invoke it from the Inspect This menu.

Call tracking

In the call tracking results window, you can double-click on the hierarchy entry to navigate to the corresponding call in the editor or expand any node to check out its incoming calls.
Tracking outgoing calls is currently not supported.

Macro substitution preview

When hovering over a macro, you can now see the macro expansion in the tooltip with full syntax highlighting and proper code formatting. You can still use the Substitute macro call context action to check out the macro expansion right in the code, but the instant preview makes working with macros easier.
Macro substitution preview

Additionally, the Quick Documentation popup (Ctrl+Shift+F1) allows you to click on any entity from the substitution preview to check out its documentation.

Updates for C++20 modules

ReSharper C++ 2022.3 introduced initial support for C++20 modules. In this update, we’ve polished our implementation to handle more corner cases and better support real-world projects that use them. We’ve also expanded the list of ReSharper C++ features that help you write modularized code:

  • Find usages now lets you find all locations where a given module is imported.
  • The Rename refactoring helps you safely rename modules and module partitions, updating all the relevant declarations and imports in your code.
  • The code formatter and Rearrange code now handle export blocks and exported entities.
  • Code completion suggests the module-related keywords and names of known modules.

Completion for C++20 modules

Support for C++23 features

The ISO C++ Standards Committee has recently completed the technical work on C++23. With many C++23 features already available in the major compilers, ReSharper C++ 2023.1 is here to help you try out the following new language features:

  • With Deducing this (P0847), you can now make the object parameter explicit with the this keyword, which simplifies the implementation of several C++ idioms.
  • auto(x) and auto{x} (P0849) allow you to make a copy of the argument as if it were passed as a function argument by value.
  • Empty parentheses () in lambdas are now optional in many cases (P1102).
  • Alias declarations are now allowed in init statements (P2360).
  • Labels are now allowed at the end of compound statements (P2324).

Deducing this
Check out this blog post for more details about new C++23 features.

Unreal Engine

You can now quickly add a simple or a complex Unreal Engine test using the new built-in file templates. Just go to Solution Explorer and right-click on the preferred project folder to open the Add menu (or use Ctrl+Alt+Insert).

Unreal Engine tests

Among other updates for Unreal Engine projects are mappings for shader source directories, a live template to add a new UINTERFACE class, and a completion item that lets you generate a lambda expression where a delegate, TFunction, or TFunctionRef argument is expected.

If you’re interested in a stand-alone cross-platform IDE for Unreal Engine development, consider Rider. Unreal Engine support in Rider and ReSharper C++ is aligned, and you can expect the same improvements in the Rider 2023.1 update.

Refactorings

You can now access most of the refactorings easily from the Alt+Enter menu in addition to the dedicated Refactor This popup (Ctrl+Shift+R).
Extract method in the Alt+Enter menu

This release includes many bug fixes and usability improvements for the Change signature and Extract method refactorings, and also a new quick-fix to create parameter from an unresolved identifier.

Create parameter

Code analysis

We’ve introduced an inspection that flags function parameters of expensive-to-copy types that are passed by value, with a quick-fix to pass the parameter by const reference instead.

Pass a parameter by const reference

The following new code inspections warn you about potential code smells:

  • Template parameter is never used.
  • Typedef/type alias is never used.
  • Redundant base class initializer.
  • Function result of type HRESULT/NTSTATUS should be used.

One more inspection lets you know when C++17 class template argument deduction fails to deduce the template arguments, allowing you to quickly add the required arguments with a fix.

ReSharper C++ 2023.1 also includes many improvements for the compile-time evaluation engine, such as the evaluation of range-based for loops and better support for unions.

Other changes

ReSharper C++ now supports the __VA_OPT__ macro, which was introduced in C++20 to help define variadic macros. This special functional macro expands to its arguments when the variable argument list is not empty and expands to nothing otherwise.

__VA_OPT__

Other important changes include an option to sort #includes in path-order or alphabetically, a postfix template to quickly make a const reference with std::as_const or AsConst, and disabled auto-insertion of the closing */ comment.

Those are the highlights of this release! We’ve also addressed many quality and performance issues – check out the full list of fixed issues in our YouTrack. More changes are coming from the ReSharper platform, like CSS support being disabled by default.

If you have any feedback or questions, please don’t hesitate to reach out to us and report issues to our tracker.

DOWNLOAD RESHARPER C++

Your ReSharper C++ team
JetBrains
The Drive to Develop

image description