CLion 2017.1 EAP: precompiled headers and -include


CLion 2017.1 EAP builds were mainly focused on C++14 features support and various code analysis improvements, as well as zero latency typing mode (that seems to improve the editor performance in many cases). Today we are happy to announce new EAP build, 171.3019.8.

Download CLion 2017.1 EAP

C++14: Variable templates and generalized lambda captures

We are moving forward with C++14 support in CLion and today we are glad to announce that variable templates (CPP-6419) and generalized lambda captures (CPP-4545) are now supported in CLion. That means that the only thing left from C++14 is constexpr.

Precompiled headers and -include support

To reduce compilation time and keep the code well-structured, especially on a large-scale code bases, precompiled headers and -include compiler option can be used. They guide the compiler to reuse the information about expensive includes (like many header files included everywhere).
In this case the IDE has to understand where to locate the precompiled headers and headers included via -include option, in order to correctly resolve symbols from such files and provide correct code highlighting, code generation and navigation, refactorings, etc.
The work on this feature in CLion has started in this EAP build:

Current limitations

In case of GCC, it’s impossible to get original PCH filename using preprocessor options like -E, -fpch-preprocess. Thus for CLion to resolve symbols from the precompiled headers correctly, you need to compiler PCH with dependency tracking enabled (with option like -MD or -MMD).

Alternatively, you can put the original file near the PCH. (CPP-8729).

Other fixes

This build also addresses a problem with TArray widely used in Unreal Engine 4 projects – no more incorrect ‘not a valid range type’ warning there.

The full release notes are available here.

The CLion Team
The Drive to Develop

This entry was posted in Announcement, Early Access Preview and tagged , , , . Bookmark the permalink.

11 Responses to CLion 2017.1 EAP: precompiled headers and -include

  1. Signer says:

    C++14 support is really appreciated. Now that variable templates are supported, it would be very nice to have formatting options for them (and for alias templates too).

  2. Andrew says:

    Oh, I was confused and thinking about one of the existing plug-ins for clion that supports clang-format, I know that exists.

  3. sancelot says:

    We have really big scale projects in which this feature will be needed.
    But really lacks of good documentation. This page is interesting but not enough complete,
    regarding gcc usage . I understand I shouyld use MD flags, where …?

Leave a Reply

Your email address will not be published. Required fields are marked *