Early Access Program

ReSharper C++ 2020.1 EAP: SpatialOS Support, GMock 1.10, and More

The second of our Early Access Program builds for ReSharper C++ 2020.1 is now available!
In this post, we’ll go through updates to C++20 support, new unit testing features, support for SpatialOS GDK, improvements to parameter name hints, and more.

Here is a list of the most notable improvements:

As usual, you can download the new EAP build from our website, or via the Toolbox App.

DOWNLOAD RESHARPER C++ 2020.1 EAP

Note that ReSharper C++ EAP builds are not fully tested and might be unstable.

Code completion

The new C++20 attributes [[no_unique_address]], [[likely]], and [[unlikely]] now appear in the completion list.

[[no_unique_address]]

You can use this attribute to mark a non-static data member that does not require a unique address. Such a data member can share its address with another data member if it has zero size. This allows the compiler to optimize the storage layout of the object so it occupies less space.
C++20 attribute: [[no_unique_address]]

[[likely]] and [[unlikely]]

You can now provide additional information to the compiler to optimize your code and mark a path of execution that is more or less likely to be executed. You can tell the compiler that a specific loop is not usually executed, and the attributes also work for branches of an if statement and cases in a switch.
C++20 attributes: [[likely]] and [[unlikely]]

Unreal Engine 4

The SpatialOS Game Development Kit is an Unreal Engine 4 fork that helps you run and manage online games in the cloud. Starting with this latest 2020.1 EAP build, we provide support for the features that are specific to SpatialOS.

ReSharper C++ now recognizes the UFUNCTION macro with the CrossServer specifier as a cross-server RPC (Remote Procedure Call):
Cross-server RPC

And there are more SpatialOS specifiers:

  • SpatialType and NonSpatialType for UCLASS help SpatialOS understand how to manage network-relevant class information:SpatialType and NonSpatialType
  • AlwaysInterested (receive all updates) and Handover (multi-server zoning) for UPROPERTY:AlwaysInterested for UPROPERTY

Unit Testing

The test runner in ReSharper C++ uses named pipes to communicate with child test processes to read unbuffered output. However, in some environments where security software is used on the machine, named pipes might misbehave. In particular, we received several reports of this happening with the McAfee security suite installed. One sign of this issue is having tests that remain in the “Inconclusive” state after a unit test run.

A new setting in this EAP build allows you to configure how to communicate with child processes. You can now disable the Use named pipes to communicate with child processes option to use temporary files instead. Please note that when this is the case, the status of unit tests will be updated only after the entire test run has finished.
Use named pipes to communicate with child processes

The mock methods generator now supports the MOCK_METHOD macro introduced in GTest 1.10. The family of MOCK_(const_)METHODn() macros used in previous GTest releases is now deprecated.
the MOCK_METHOD macro introduced in GTest 1.10

Parameter name hints

Parameter name hints became an inherent aspect of the development experience with ReSharper C++ (check out our post about all the available hints). And now they are available in dependent code too:
Parameter name hints in dependent code

Other changes

  • Better error messages about complex unsatisfied constraints when using C++20 Concepts. This work is in progress, so stay tuned!
  • The Change Signature refactoring now accepts non-resolving types.

The full list of all the issues fixed in this EAP build can be found in our issue tracker. We look forward to your feedback!

DOWNLOAD RESHARPER C++ 2020.1 EAP

Your ReSharper C++ team
JetBrains
The Drive to Develop

image description