Quantcast
Channel: CLion : A Cross-Platform IDE for C and C++ | The JetBrains Blog
Viewing all 681 articles
Browse latest View live

CLion 2018.3 EAP: new build and rebuild actions

$
0
0

Hi,

The new CLion 2018.3 EAP (build 183.3283.6) is now available for download!

As usual, a patch-update will be available shortly for those using the previous EAP build, and you can also use Toolbox app or snap packages (in the case of Ubuntu) to get this build. No license is required and the build is free to use, but it will expire within 30 days of the build date.

Download CLion 2018.3 EAP

New Build menu

In this build we’ve addresses a family of requests for various build/rebuild actions for particular targets or whole project by adding a new Build menu with new and updated options:
build_menu

These are the available options for CMake projects:

  • Build Project – a new action which builds CMake all targets from all CMake Profiles configured for the current project:
    build_project
  • Build All in <selected CMake Profile> – a new action which builds CMake all target from the selected CMake Profile
  • Build <selected configuration> (Ctrl+F9 on Linux/Windows, ⌘F9 on macOS) – an old action which builds the selected Run configuration
  • Recompile current file (Shift+Ctrl+F9 on Linux/Windows, ⇧⌘F9 on macOS) – recompiles currently opened file or a group of file, if selected in the Project View
  • Install – works as before, runs cmake install on your project
  • Rebuild Project – a new action which calls Clean and then Build Project
  • Rebuild All in <selected CMake Profile> – a new action which calls Clean and then Build All in <selected CMake Profile>
  • Rebuild <selected configuration> – a new action which calls Clean and then Build <selected configuration>
    rebuild_configuration
  • Clean – works as before, cleans the project

As a side effect of these changes Build All run configuration is not created for the new projects anymore (previously CLion was automatically creating it). Build Project action serves as the most global build action as it doesn’t require any CMake Profile or Run configuration to be selected in advance.

Finally, we’d like to remind you that CMake Profiles can be configured in Settings/Preferences | Build, Execution, Deployment | CMake. And you can switch between them later in the Run/Debug configuration switcher:
configuration_switcher

Find the full release notes by the link.

CLion 2018.2.5 EAP

A preview build for CLion 2018.2.5 bug-fix update is also available. Download build 182.4892.4 from our confluence page or wait for a patch-update. Please, note that this EAP build requires an active subscription (or you can start a 30-day evaluation period).

This EAP build brings the following fixes:

  • Creation of the GitHub token fails in some cases when the name already exists (IDEA-198120)
  • Deleting with Backspace merges lines by mistake (CPP-13177)

Full release notes are linked here.

Your CLion Team
JetBrains
The Drive to Develop


JetBrains C++ team at CppCon 2018: trip report

$
0
0

Our C++ team is on its way back home from Bellevue, Washington, where CppCon was held during the last week of September. While our memories are still fresh, we’d like to share our impressions of this year’s installment of CppCon.

cppconAs the biggest and most global C++ event, CppCon gathers attendees from all over the world and unites C++ developers of all levels of knowledge across many areas. Classes, sessions, panels, podcast recordings, lightning talks, open-content sessions, exhibition tables, posters – all these different formats help participants share their knowledge of all aspects of C++ development.

IMG_0072This year was unique for many reasons. First, the conference finally outgrew the maximum space available in Bellevue, and that’s why next year’s CppCon will move to a new place in Aurora, Colorado, a city near Denver. We all felt a little sad about leaving the Seattle area and spent the week trying to capture all the good memories of this place.

Second, several new formats entered the program including Lightning Challenges and Tools Time.

Third, the organizers opened the first floor to companies who’d like to communicate more closely with the C++ developers at the event.

There were many more points that made us think this CppCon was a huge success. Let’s talk about some.

Talks

This year’s keynotes were exceptional and highly technical. Bjarne Stroustrup talked about Concepts, which in his opinion simplify designs by being a better specification of the interface, give precise error messages as early as possible, and scale well. He also discussed the typical question that bothers C++ developers: accidental false matches. From his point of view, this can only happen if two entities only differ in semantics (like backward vs forward iterator). But generally, concepts rarely produce a false match. So while concepts don’t catch all type errors, they are still a powerful language feature to make C++ simpler and safer.

Kudos to Bash Films who did the official video recording at the conference. Many talks are on YouTube already, and Bjarne’s keynote session was online on Tuesday, the next day after the actual talk!

Another keynote had a surprising and exciting title – Patterns and Techniques Used in the Houdini 3D Graphics Application – and lived up to it! How amazing was it to see C++ developers on stage accepting an Academy Award?! Having the C++ committee receive such recognition, on that stage, was an incredible feeling! Mark Elendt shared the story of SideFX and the Houdini application, as well as the language-level solutions and patterns they used. Since Houdini has been around for a while, it’s interesting to see the evolution of the ideas and compare custom solutions at every point in time with those available in the standard library and the language in general.

Next up was Herb Sutter with Thoughts on a more powerful and simple C++, a self-reflection on the evolution of the language. Herb discussed how modern C++ language abstractions make user code simpler, let developers deprecate problem features, and remove unnecessary special cases. Still, these language abstractions need to follow the 3 main principles of C++: zero-overhead abstractions, determinism and control, and link compatibility. This philosophic part was followed later by an update on two areas Herb is currently working on: bringing metaclasses to C++, and introducing lifetime update checks. 
The goal of the former is to give a name to a subset of types with common characteristics. Since the first announcement at ACCU 2017, the proposal has evolved. In his keynote, Herb showed the updated syntax and a couple of new real-world samples where metaclasses seems to be very useful indeed, like properties in C++ and a synchronization sample. Last but not least, how good it would it be if we got rid of macros and switched to modules, constexpr, and metaclasses instead?

The second part of Herb’s update was dedicated to the Lifetime proposal. This was later complemented by a talk from Matthias Gehre and Gabor Horvath exposing the details of Clang implementation (which you can already try in Compiler Explorer on a special clang branch – pass the -Wlifetime flag to the compiler). The idea is to have lifetime checks running fast enough to perform in the IDE and during compilation. It’s reported that Clang implementation has ~5% compile-time overhead on large LLVM files. I assume these checks will soon land in clang and maybe other compilers, so keep an eye on it and check out the proposal for more details.

The last big session was run by Chandler Carruth and dedicated to Spectre and the famous meltdown issues. This presented a perfect opportunity to deeply understand the problem by digging into the assembly code on various samples. Finally, possible solutions and actions were discussed. This talk was followed by a dedicated Spectre panel, which allowed the audience to discuss the topic, share their concerns and fears, and ask for practical advice from experts representing Google, Microsoft, and Red Hat.

I’m afraid I can’t cover all of the amazing talks we had the pleasure of listening to, but a few deserve a special mention:

  • In his talk on initializers, Nicolai Josuttis discussed the Almost Always Auto principle, issues with types consisting of several words, narrowing conversion, and issues with initializing an array<>.
  • Compile time regular expressions, by Hana Dusíková. Many attendees I’ve talked to called it one of this year’s best talks. Even though the CTRE library was accepted as a draft to C++20, it still doesn’t work in any of the modern compilers. But the _ctre language extension does for GCC and Clang. Hana showed the implementation for the latter, as well as many interesting samples and of course the benchmarks.
  • What could possibly go wrong?, by Simon Brand and Phil Nash. This should be of interest for anyone wondering why Herb Sutter started this whole exception handling movement. In their talk, Simon and Phil tried to demonstrate and evaluate all the options for error handling available in the language today, giving scores and validating various improvements.
  • Best practices in C++, by Jason Turner, based on his GitHub-based materials at http://cppbestpractices.com/. This is a treasure trove of great advice that every C++ developer should check out to make sure they are aware of possible issues that may creep in and ways to resolve them. The topics discussed included proper getter accessors, trailing return types, and constexpr downsides, among others.
  • Finally I’d like to mention the talk of our friend Matt Godbolt, Bit between the bits, which can come in very handy for those who want to dive into the details of the compiler/linker job, for example, to learn how global constructors work.

We are also happy and proud of our team members who managed to get 5 talks into the program!

Over to Phil Nash

Once again, I only managed to attend a handful of talks owing to my own commitments (two full talks, a lightning challenge, Tool Time, a panel, two full live podcast recordings, a lightning podcast appearance, and a two-day class – phew!). What I did see was very much in keeping with the sentiment that I have heard from many attendees: this was the best CppCon yet! It was also the biggest – I heard (so maybe official figures will differ) that over 1,300 attended the conference in total! There are much bigger tech conferences out there, but in the C++ world that’s about double the next biggest that I know about. What’s amazing is that, even at this scale, there is still a friendly community feel to the event. It’s not as intimate as some of the smaller conferences, but has its own unique quality that you can only really experience by being there in person.

Of the talks I saw, Andrei Alexandrescu’s coverage of the proposed std::expected was the first. Andrei always gives a great talk and, dare I say it, this was no “exception”! But I had a particular interest in this topic as I would be covering much the same material in my joint session with Simon Brand the following day. As “expected” (sorry, it’s a rich seam here), there was a large overlap between the two talks – and Andrei even used a similar approach of weighing up the pros and cons using a number of dimensions. However, the presentation style, ultimate direction and conclusions were also different enough that I think people who saw both talks got something out of each. In fact I asked at the start of mine how many had attended Andrei’s and a substantial number raised their hands. I think that’s an indication of the interest in the topic. By the way, the main difference was that Andrei stopped at std::expected, whereas Simon and I went on – first to show how adding a set of monadic operations can help improve things further, and then to show how the Static Exceptions proposal takes the whole thing to its ultimate conclusion.

My other main talk was on Catch2 and was a bit of an update and refresh of one I have given at some other conferences last year. There were two big additions to Catch2 since the last ones that I covered: generators and support for -fno-exceptions.

This year we saw the introduction of a new evening session on Tuesday, Tool Time. This was a “tech labs” style event where anyone who wanted to represent a tool (an application, framework or library) could do so on a level playing field. We were there with CLion and ReSharper C++, of course, but it was also nice to see tables with one-person open-source projects alongside us. I wasn’t able to join the JetBrains tables myself, because I was running the session! I think it was a success and we’ll be doing it again – although it was unfortunate that it coincided with the first evening of the Lightning Challenge talks, which were very popular.

Talking of Lightning Challenges (more on them later), I did one on Thursday entitled You’re Not As Smart As You Think You Are, which dug into the science of cognitive limits, how it relates to our code, and what we can do about it. However, that particular lightning talk session was memorable for two other entrants: Simon Brand using a glass of water as a metaphor for monads, then proceeding to illustrate what using an optional without a monadic interface was like by emptying the water over his head! On the more serious end of the spectrum – yet with artful lighthearted flourishes – the inimitable Walter Brown took us on a tour of his mentors over the years, and concluding that he now realizes it is too late to thank them and tell them how much they have shaped him, because they are no longer with us. The implication is that, if we have the chance, we should not wait so long. Who are your mentors? In your career, in technology, in life? Do you appreciate what you have gained from them? Have you told them and thanked them? Don’t wait too long.

Back to Anastasia…

Booths, tables, and Tools time

The CppCon exhibition grows year by year. In 2018, it added the first floor giving attendees a wider variety of companies to talk to. We thank everyone who visited the JetBrains booth on Monday, Wednesday, and Thursday – it was a pleasure talking with you! Some attendees even tried our C++ quiz and won T-shirts right on the spot, while others participated in the license raffle. Meanwhile, the raffle survey gave us an overview of the C++ standards and compilers mostly used by the attendees. The distribution of C++ standards correlates with what we previously saw in the JetBrains Developer Ecosystem survey and the C++ Developer Survey that the C++ Foundation ran earlier this year:
cpp_standard
It’s also worth mentioning that C++17 has increased its share compared to last year, if we go by the survey we run at CppCon on a regular basis.

In terms of C++ compilers, GCC dominates even though it’s lost some points over the year, while MSVC and Clang are approaching fast:
cpp_compiler
Making its debut, the Tools Time format gave all tools and library developers an opportunity present their work and talk to end-users on an equal footing. Even though the lightning talks, open-content session, and Tools Time all competed for attendees, we think the format was successful and we’d like to thank those who participated and especially those who came to the CLion and ReSharper C++ tables.

Lightning talks and Lightning Challenge

This year was the first time to run the brand-new Lightning Challenge format. The rules are tough – a speaker only gets 3 minutes guaranteed, then 3 more minutes can be added if 50% of the audience vote yes, and finally 2 more minutes are added if 70% vote yes. Sounds challenging, doesn’t it? Phil Nash, Timur Doumler, and yours truly decided to participate as we love a challenge. Since the format was experimental, only 6 topics were accepted to the challenge, and surprisingly all 6 speakers got their full 8 minutes. Believe me, when you get on that stage and the clock and voting counter are ticking, you feel the adrenaline! The energy and excitement in the room went through the roof.

We would like to invite every C++ developer to participate in CppCon next year in Colorado. The conference is scheduled already for the week of September 15-20, 2019, so mark the dates in your calendars today!

The JetBrains C++ Team
The Drive to Develop

CLion 2018.3 EAP: profiling tools on Linux and macOS and multiline TODO

$
0
0

Hi,

The new CLion 2018.3 EAP (build 183.3647.14) is now available for download!

As usual, a patch-update will be available shortly for those using the previous EAP build, and you can also use Toolbox app or snap packages (in the case of Ubuntu) to get this build. No license is required and the build is free to use, but it will expire within 30 days of the build date.

Download CLion 2018.3 EAP

CPU Profiler

Starting from this EAP, CLion comes with the CPU Profiler integration on Linux and macOS. With Perf on Linux and DTrace on macOS you can now analyze the performance of your application (both, kernel and user’s code) right in the IDE.

To run the profiler use a new button in the navigation toolbar or a new action in the run menu, which appears when you click on a run icon in the left gutter:
run_profiler

The results of the profiling is shown in the CPU Profiler tool window (View | Tool Windows | CPU Profiler):
profiler_toolwindow

How to start profiling the code?

Before you start profiling your app, please check and install, if missing, the following tools:

  • On Linux:
    1. Perf is required to run profiling in CLion. Mind, you should install perf for the particular kernel version you have. For example, on Ubuntu you can check the kernel version via uname command and then install the linux-tools package for the particular kernel version:
      anastasiak2512@ubuntu:~$ uname -a
      Linux ubuntu 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
      anastasiak2512@ubuntu:~$ sudo apt-get install linux-tools-4.15.0-34-generic
    2. Besides, you have to allow perf collect information without root privileges. For that you have to tweak /proc/sys/kernel/perf_event_paranoid and update /etc/sysctl.d/local.conf if you want to keep the setting across system reboots:
      sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'
      sudo sh -c 'echo kernel.perf_event_paranoid=1 > /etc/sysctl.d/local.conf'
    3. addr2line tool is also required to show human-readable (demangled) names in the output and to navigate to the source code. It’s part of the binutils package, so you likely have it by default. Otherwise, install binutils.
  • On macOS:
    • DTrace is required to profile on macOS. Most likely, you have it installed by default with your macOS. You can call dtrace command in the terminal to check it.

Perf and DTrace executables will be detected automatically by CLion. Or you can set the path in Settings/Preferences | Build, Execution, Deployment | Dynamic Analysis Tools | Profiler. Besides, you can configure sampling frequency there.

In order to get meaningful profiler data and ability to navigate through it properly, the application need to be build with debug info and without any optimizations, so we recommend using the Debug configuration with -O0 compilation flag.

CPU Profiler tool window

When you start profiling the app, CLion notifies you if the profiler is successfully attached. When the profiling data is ready, CLion shows a balloon with a link to the CPU Profiler tool window with the results. Alternatively, you can open it via View | Tool Windows | CPU Profiler.
profiler_data_ready

In the tool window you can find several useful tabs with the profiling information collected: flame chart, call tree and method lists.
profiler_tabs

Known issues and limitations

CPU profiler integration in CLion is implemented on Linux and macOS platforms. We’ll consider possible tools on Windows later in 2019. Besides, there are a few limitations in the current implementation:

  • Navigation to the source code is available on Linux only for now.
  • By default CLion runs the profiler with quite high sampling frequency, which might require a lot of disk space for long-running programs. Decrease this value in Settings/Preferences | Build, Execution, Deployment | Dynamic Analysis Tools | Profiler to avoid such situations.
  • Profiler integration in CLion currently doesn’t support WSL toolchain or remote mode.
  • Currently profiling works for CMake and Gradle projects. Projects with compilation database project model are not supported.

Multiline TODO comments

With this EAP we bring you multiline TODO comments, which means the first and all subsequent todo comment lines can be highlighted in the editor and listed in the TODO Tool Window (it was only the first line previously). Just add an indent starting from the second line of your multiline TODO comment so the IDE will differentiate it from an ordinary comment:
Multiline TODO comments

That’s it! Give this new CLion EAP a try and let us know what you think! Full release notes are available by the link.

Download CLion 2018.3 EAP

Your CLion Team
JetBrains
The Drive to Develop

CLion 2018.3 EAP: remote development on Windows, high-contrast theme and other platform improvements

$
0
0

Hi,

The new CLion 2018.3 EAP (build 183.3795.17) is now available!

If you have the previous EAP build installed, simply get a patch-update right in the IDE. Or use Toolbox App or snap packages (in the case of Ubuntu) to get this update. No license is required and the build is free to use, but it will expire within 30 days of the build date.

Download CLion 2018.3 EAP

Remote toolchain support on Windows

CLion 2018.3 EAP introduced initial remote development support. Now it’s possible to use Windows as a local machine, in addition to Linux and macOS.
remote_host_windows

A few things are worth mentioning:

  • Because of the IntelliJ platform issue with case sensitivity, you need to add property (Help | “Edit Custom Properties…”) idea.case.sensitive.fs=true, restart CLion and rebuild the project index (File | “Invalidate Caches and Restart”) after that.
  • On Linux and macOS CLion uses rsync to synchronize sources. On Windows CLion relies on tar and CLion’s own Remote Host Access utilities, and it seems to be slower than native rsync on macOS and Linux (CPP-14440).

High Contrast Theme

The new high-contrast theme implemented in IntelliJ Platform has finally landed in CLion EAP. You can access it via Settings/Preferences | Appearance & Behavior | Appearance | UI Options (to switch the whole IDE) or via the Ctrl+` shortcut (to switch the editor only).
high_contrast
The work is still in progress and we would appreciate your feedback very much!

IntelliJ Platform improvements

There are more enhancements in CLion 2018.3 EAP coming from IntelliJ Platform. They include:

  • Git submodules support: repository with submodules are cloned recursively, Diff, History, and Conflict resolution now work for submodule folders, and updating the project correctly updates the submodules (IDEA-64024).
  • A new GitHub Pull Requests tool window was added to view all pull requests from your GitHub repository as a list inside the IDE.
  • A new experimental Activity Monitor (Help | Activity Monitor) was added to show how much CPU the subsystems and plugins (both built-in and additionally installed) are consuming.
  • Plugins UI: Preferences/Settings | Plugins page got a fresh look, making it easier to manage, install, uninstall, and update the plugins:
    plugins_ui_settings

Full release notes are available by the link.

To catch up on all the new features in v2018.3, check out the previous EAP blog posts:

CLion 2018.2.5

Besides, CLion 2018.2.5 bug-fix update (build 182.4892.24) is now available! It addresses an issue with Replace in Path / Find in path dialogs losing focus (IDEA-198588), a problem with GitHub token creation (IDEA-198120) and deleting with Backspace issue (CPP-13177). Full release notes are available here.

Your CLion Team
JetBrains
The Drive to Develop

C++ Annotated: June – September 2018

$
0
0

Hi,

A new edition of C++ annotated brings you a collection of the most important and engaging news from over the last 4 months that you should definitely check out. In this edition:
800x320_Twitter_card

CppCon 2018

cppconThe summer months were marked by only two C++ events: C++ committee meeting in Rapperswil, Switzerland, and ++It – a small but aspiring C++ conference in Milan, Italy. In September, however, a hot C++ conference season kicked off again with CppCon. Pacific++, C++ CoreHard, Meeting C++, ADC, code::dive, and the C++ Committee meeting in San Diego, California, are coming up later this year.

This year’s installment of CppCon was called the best ever by many attendees (though not all). We fully agree! The Keynotes this year didn’t unveil any new surprises but summarized the huge and important work going on in the C++ world. Bjarne Stroustrup talked about the importance of Concepts, while Herb Sutter analyzed the language evolution and discussed the metaclasses proposal update and new lifetime checks. Chandler Carruth ran a mind-blowing keynotes session on Spectre and the famous meltdown issues, followed by a dedicated panel.
Regular sessions covered a whole variety of C++ topics: initialization, compile-time programming in C++20, and compile time regular expressions (this talk by Hana Dusíková is said to be the best one this year by many attendees!), discussions on modules, lifetime, new static exceptions, memory tagging technique, and tooling. There were also some really useful general learning sessions, such as Best practices in C++ by Jason Turner. Quite a few sessions are already available on YouTube – now you just need to find some time to watch them! There are several trip reports worth mentioning:

In addition, you may want to watch the Channel9 interview (recorded right at CppCon) with Bjarne Stroustrup and Gabriel Dos Reis talking about Concepts. “Your compiler doesn’t know what you are trying to do; it only knows what you did,” says Bjarne in the interview, and this is why concepts are specially created to explain your intentions to the compiler in the world of metaprogramming.

Proposals you can’t miss

Today we are starting a new section in our regular C++ Annotated. In each issue, we will cover a selection of C++ proposals and initiatives you definitely should learn about while developing in C++. This time we unveil static exceptions, constexpr new, and lifetime checks. See details below.

Static exceptions

exceptions
p0709r1
Thought exceptions weren’t for you? Do you have hard real-time requirements, need absolute determinism, and are concerned about performance, or do you just think that exceptions are only for “exceptional” situations?

This proposal changes all that and gives you a combination of all the best parts of exceptions and return codes, without the corresponding trade-offs. Think that’s too good to be true? Read the proposal – or watch one of Phil’s talks (at C++ Now 2018 and at CppCon 2018).

Constexpr new

p0784r4
The proposal is actually (currently) “More constexpr containers” (formerly “Standard containers and constexpr”). Right from the introduction it cites, as motivation, Ben Deane and Jason Turner’s classic talk, “constexpr All The Things”. A large part of the proposal is dedicated to dynamic allocation within a constexpr context – which also requires addressing constexpr destructors. If this is already blowing your mind, wait until you hear about transient vs non-transient allocation! If it’s not, then either you’re already familiar with the proposal, or you’ve not done enough constexpr or template-metaprogramming to get scared yet! There are a number of concerns that need to be addressed. The proposal picks them off, one by one, and proposes approaches which sound sensible for each.

Lifetime

lifetime_sample
This is not actually an ISO proposal, but rather a refinement of one of the big promises from the Core Guidelines, which Bjarne Stroustrup first unveiled at CppCon 2015. Then it was followed up at the same conference by Herb Sutter, who dug deeper into the lifetime parts. The promise, from Herb’s follow-up, was that, if the Core Guidelines (or at least the parts relating to object lifetimes) were implemented by compilers and/or static analyzers to a sufficient degree, lifetime and ownership issues could be a thing of the past – and possibly many uses of smart pointer would be unnecessary! We know that Rust has achieved the same sort of thing, although the concern there is that the syntax is very annotation-heavy. The CG approach requires much less in the way of annotations.

At CppCon 2018, Herb gave us an update on this. The original dream may be too ambitious to do in full for now, but by limiting the scope to catching common cases we can still eliminate many of the worst types of lifetime issues, such as dangling references, that plague us today.

Learning

Constructing C++ objects without copies

fluent_cppThis guest blog post at Fluent C++ by Miguel Raggi is all about minimizing copies when constructing an object that holds a value. And while copying from lvalue/moving from rvalue case is simple, referencing an lvalue/moving from an rvalue is actually not. The article goes through the solution step by step, discusses the use of forwarding references, and suggests a way of adding const to the stored reference when lvalue is provided as input.

Std::shared_ptr via make_shared or constructors?

simplify_cppThis article by Arne Mertz raises the question, “How is it better to construct std::shared_ptr?” Obvious candidates are std::make_shared and std::shared_ptr constructors. The author provides a nice visual representation of the memory allocation happening in both cases to explain the difference. While one might say that a single allocation is always better, there are pros and cons for std::make_shared. For example, when talking about the drawbacks of a single allocation solution, it has to be granted proper access rights and might lead to a considerable amount of memory locked in specific cases.

Everything You Need to Know About std::variant from C++17

std_variant
Bartlomiej Filipek runs a very useful series about C++17 Library Utilities in his blog. If you want to learn about std::optional, std::any, std::string_view, or std::filesystem, his blog is the right place to do it. You will find detailed descriptions and samples, as well as an overview of cases where the feature is useful and required. The blog post we’d like to mention here is dedicated to std::variant, a type safer union, especially when complex types are used inside. The main benefit is that the object lifetime which std::variant cares about automatically calls the destructor when needed. From the article, you can learn how to create std::variant and what std::monostate is, how to change the value in std::variant, and how to use the corresponding helpers and visitors. Finally, you’ll learn about memory consumption (no dynamic allocations are used!) and go through several real-world use cases.

Passing overload sets to functions

function_return
Andrzej Krzemieński in his blog raises an interesting problem about passing a function name as a function argument, which actually names an overload set and not a particular function. Now, take into consideration that the C++ standard is allowed to change function signatures and overloads in the standard library in the backward compatible way. This means we’ve come to a situation where code compiles with one standard library and fails with another one, or the code might stop compiling with the standard library evolution in time. Andrzej discusses the possible solutions, including passing in a function object or using lambdas. Some trickier macros and even a language proposal are also covered in the article.

Useful non-default GCC address sanitizer checks

sanitizers_flags
Google Sanitizers are very handy nowadays for catching particular groups of errors, including memory issues. In this article, Krister Walfridsson lists some useful GCC address sanitizer checks that are not on by default, but you may want to consider using them. Use after return, comparing pointers from different objects, subtracting pointers to different objects and out-of-bounds accesses to the unused capacity of a std::vector are covered. By the way, in CLion we have the first check enabled in CLion’s default configuration, because we consider it super useful for many dangerous error cases.

C++ Committee meeting in Rapperswil

cpp_logoIn June, the C++ Committee held a meeting in Rapperswil, Switzerland, which was very important as it was one of the last meetings on the design of major C++20 features. C++20 is expected to be feature-complete by the beginning of 2019. And while some topics are still triggering hot discussions in the committee (for example, talking about Modules), if you check out the summary from Bryce Lelbach on reddit, the majority of the work is mostly done now. In Rapperswil, contracts, standard library concepts, feature test macros, NTTP, and other features were added to the C++20 draft. Our JetBrains C++ team was also happy to join the meeting, as you can find out from our report.

Life as a C++ Dev

This unusual post on reddit is a great opportunity to find out what the typical conditions the C++ developers around us are working in. Pre- or post- C++11 code, legacy code base or freshly started projects, custom STL library, C with classes, a story about throwing away a 900-line template – check out how the C++ world looks when it comes to real developer stories. And maybe share yours in the comments!

Releases

Qt Creator

qt_logoQt Creator 4.7 was released in July. In this version, the Clang code model was finally turned on by default, improving the accuracy of code analysis, highlighting, completion, and renaming (for local symbols). Some other changes include the Run Test Under Cursor action and improvements on Windows for MSVC.

Things are moving quickly forward and Qt Creator 4.8 Beta is already announced, promising a client for the language server protocol to Qt Creator. The client is capable of performing code completion, highlighting of the symbol under cursor, and jumping to the symbol definition. LSP integration is getting more and more attention nowadays from IDE vendors. For example, Apple recently announced a new LSP language service supporting Swift and C-family languages.

Sourcetrail 2018.3

sourcetrailA cross-platform source code explorer and visualizer, Sourcetrail had another big update in August. It now allows code browsing while indexing the project, which improves the performance aspect a lot as C++ projects can take quite a long time to index. Two new supported source group types include Code::Blocks and Sonargraph. Besides this, the graph view was also improved, as well as the code view getting some useful enhancements, like better local references navigation and automatic horizontal scrolling to the source code position.

Visual Studio 2017 version 15.8

vs_cppAugust was also the month to release the new Visual Studio. Since this version, C++ developers can benefit from a notable debugger feature – Just My Code enables them to step-over code from system or third-party C++ libraries in addition to collapsing those calls in the call-stack window. Regarding the work with macros, the C++ Quick Info tooltip shows the macro expansion, and you can also now convert a macro to constexpr. Besides these additions, IntelliSense for templates makes it possible to use code completion inside the template body, which is based on the provided information about the type used to instantiate the template.

CLion 2018.2

CLion_400x400_Twitter_logo_whiteCLion is definitely becoming more mature and growing into a strong member of the C++ family. The new release at the end of July brought with it a Clangd-based language engine as a complementary engine to CLion’s own language engine, for showing code errors and warnings in the editor. On the one hand, it’s a first step in experimenting with how many language-related features we’ll be able to implement on top of clangd. On the other, it’s a great addition to CLion’s functionality, enabling accurate code analysis for many tricky C++ cases, especially those where the latest C++ standards are in use.
CLion has also added support for two new project models: compilation database and Gradle for C++. The first one actually means you can now work with Makefiles projects in CLion, using a workaround described in our blog. Google Sanitizers support, the Database Tools and SQL plugin, and other massive improvements made this release a big thing!

If that’s not enough, check out the Early Access Program for the upcoming 2018.3 release, which already gives you the opportunity to evaluate remote development support in CLion and the CPU profilers integrations.

ReSharper C++ 2018.2

R++_400x400_Twitter_logo_whiteReSharper C++, a Visual Studio extension for C++ developers, also had an important update. One of its key improvements, however, is mostly interesting to those who work with both C++ and C# code, and use ReSharper Ultimate. From now on, ReSharper C++ will provide initial support for C++/CLI, a set of C++ language extensions by Microsoft designed for easy interoperability between managed and native code. Code analysis, typing assistance, formatting, and code completion were all updated to support C++/CLI. Navigation actions and will work across both – C# and C++/CLI.

Version 2018.2 also added support for a huge set of C++17 features and even some from C++20, like CTAD, fold expressions, coroutines, designated initialization, and more. And finally, ReSharper C++ now provides spell-checking functionality out of the box!

ReSharper 2018.3 Early Access Program has been opened already, bringing you predefined naming schemes for common C++ code standards and huge performance improvements for Unreal Engine 4 projects.

CLion 2018.3 EAP: fixes for remote dev, CPU profiler and Markdown plugin

$
0
0

Hi,

Please welcome a new CLion 2018.3 EAP (build 183.3975.20)!

As usual, a patch-update will be available shortly for those using the previous EAP build, and you can also use Toolbox app or snap packages (in the case of Ubuntu) to get this build. No license is required and the build is free to use, but it will expire within 30 days of the build date.

Download CLion 2018.3 EAP

This build brings the following improvements:

  • Remote development on Windows: fixed an issue when CLion can’t find standard library includes because of a specific tar compression.
  • Small UI improvement for CPU Profiler integration: Profile action in the run icon in the left gutter was updated to include a missing underscore to separate different words in the target name.
  • Markdown plugin got a fix for an IDE freeze on Linux caused by a Markdown file (IDEA-200822).

Full release notes are available here.

Your CLion Team
JetBrains
The Drive to Develop

CLion 2018.3 EAP: various fixes

$
0
0

Hi,

Please welcome a new CLion 2018.3 EAP (build 183.4139.25)!

As usual, a patch-update will be available shortly for those using the previous EAP build, and you can also use Toolbox app or snap packages (in the case of Ubuntu) to get this build.

Thanks to our users, we’ve noticed that a week ago a patch update wasn’t uploaded properly. We are sincerely sorry for that and will upload the patch for the previous EAP build this time as well. We’ll do our best to avoid such situations in future.

No license is required and the build is free to use, but it will expire within 30 days of the build date.

Download CLion 2018.3 EAP

This build brings the following improvements:

  • Load CMake Project action failed if project was opened as directory. This happened in particular on projects created from Unreal Engine editor. Now such projects can be opened successfully.
  • When using Remote Development from Windows machine or WSL toolchain, custom GDB path was reset to default every time the dialog was closed. This is fixed now.
  • Valgrind Memcheck default configuration in CLion was updated to work properly with Valgrind v3.13.
  • On macOS Mojave the input is no longer freezing after pressing key-selector (JRE-998).

By the way, talking about macOS 10.14 Mojave, GDB currently doesn’t work there (CPP-14546). We plan to investigate the issue as soon as possible. But until that, please use LLDB on macOS.

Full release notes are available here.

Your CLion Team
JetBrains
The Drive to Develop

CLion 2018.3 EAP: clangd-based navigation and search, CPU Profiler and remote mode improvements

$
0
0

Hi,

Please welcome a new CLion 2018.3 EAP (build 183.4284.40)!

As usual, a patch-update will be available shortly for those using the previous EAP build, and you can also use Toolbox app or snap packages (in the case of Ubuntu) to get this build.

No license is required and the build is free to use, but it will expire within 30 days of the build date.

Download CLion 2018.3 EAP

Clangd-based navigation and search

In CLion 2018.2 we’ve introduced an experimental complementary language engine, based on Clangd. Initially it worked only as an error annotator, providing code errors and warnings in the editor. Now it’s also used by CLion for some navigation and search actions:

  • Go to declaration (Ctrl+B on Win/Lin, ⌘B on macOS) / go to definition (Ctrl+Alt+B on Win/Lin, ⌥⌘B on macOS).
  • Highlighting references under caret.
  • Quick Documentation popup (Ctrl+Q on Win/Lin, F1 on macOS)
  • Find Usages (Alt+F7) – it uses Clangd-based engine to search through the files opened currently in the editor and CLion’s own engine for all the other usages.

CLion’s own engine is still in use for all the actions not listed above and also for the cases when Clangd-based engine fails. Besides, CLion adjusts the results it gets from Clangd in some cases (for example, it goes to the constructor not class declaration, when navigating from the constructor call).

Clangd-based language engine in CLion is turned on by default on all platforms. You can change the default configuration in Settings/Preferences | Languages & Frameworks | C/C++ | Clangd:
clangd_preferences
Note that if you’d like to turn off the Clangd-based engine completely in CLion, you need to uncheck all the options in this dialog.

Navigation in CPU profiler, fixes for remote and more

Jump to Source action in CPU Profiler tool window now works not only on Linux, but on macOS as well:
jump_to_source_cut

Remote mode was improved in this build thanks to a few important fixes delivered:

  • An ability to exclude paths when synchronizing the sources to the remote machine for remote toolchains in CLion (CPP-14275).
  • Different deployment configurations are now used for different toolchains (CPP-14014). This also allows to copy remote toolchain correctly (CPP-14626).

Full release notes are available here.

Your CLion Team
JetBrains
The Drive to Develop


CLion 2018.3 Release Candidate

$
0
0

Hi,

Please welcome the first Release Candidate for the upcoming CLion 2018.3!

Get the build (183.4284.104) from our website or use Toolbox app or snap packages (in the case of Ubuntu) to update. A patch-update will be available shortly for those using the previous EAP build. No license is required and the build is free to use, but it will expire within 30 days of the build date.

Download CLion 2018.3 RC

Here are some of the highlights:

  • For CPU Profiling on macOS we’ve fixed the “No data profiler” error, which happens in some cases.
  • Regression with an “Optimise Imports” action working incorrectly in case of the Clangd-based engine enabled.
  • Local build directory is no longer synchronized to the remote host (is added to Excluded paths automatically now).

Full release notes are available by the link.

Your CLion Team
JetBrains
The Drive to Develop

CLion 2018.3 Release Candidate 2

$
0
0

Welcome the 2nd release candidate (build 183.4284.140) for CLion 2018.3!

Please note that to use CLion 2018.3 RC2, you need to have an active subscription (or start a 30-day evaluation period). No patches are provided for this release candidate, but you can expect a patch from the latest 2018.2.6 update to the 2018.3 release version.

Download CLion 2018.3 RC2

As things get closer to the official release, we are mostly working on the final fixes and improvements. If you notice any problems at all, please report them to our tracker.

This build delivers the following fixes:

  • IDE freeze: the IDE no longer freezes on typing related to clangd (CPP-14702)
  • WSL toolchain: CMake loading performance was improved (CPP-14700)
  • Search Everywhere: left and right side texts do not overlap now in the updated Search Everywhere dialog

Find the full release notes on our confluence page.

Bug-fix updated to 2018.1.7 and 2017.3.5

Along with the 2018.2.6 update published a week ago, we’ve just released updates for 2018.1 and 2017.3 version. You can get these updated from our Toolbox App or via patch-updates. The released builds are also available on our site.

Make sure to get these bug-fix updates if you are using macOS Mojave, as they include a fix for the input freezes (JRE-998).

Your CLion Team
JetBrains
The Drive to Develop

CLion 2018.3 released: remote development, CPU profilers, C++17, clangd-based navigation, and VCS and editor improvements

$
0
0

This year we’ve focused on two areas to enhance CLion. The first is better C++ language support and general IDE performance improvements. As a result, we’ve added a clangd-based experimental complementary language engine, and a massive amount of work was done which, although invisible at first glance, has helped eliminate dozens of UI freezes in the editor.

The second area is the endless world of remote configurations. Starting with Windows Subsystem for Linux (WSL), by the end of the year it has evolved into full remote development support.

Our efforts in both of these areas have culminated in this year’s final major release which is CLion 2018.3. Let’s look at all the goodies it brings with it in more detail!
CLion_183

2018.3 gathers the following changes under one roof:

Grab your free 30-day trial of CLion to evaluate the new features and improvements. Check them out in this quick demo from Phil Nash, or read on for more details:

Download CLion 2018.3

Remote development

You can now develop remotely from a Windows, Linux, or macOS client machine to a Linux remote host. Note there are two major constraints to the configuration for now:

  • It works only for CMake-based projects (CLion also supports Gradle and compilation database project model, but remote development for them is not yet supported).
  • The setup assumes the source code is located on a local machine, which CLion synchronizes using rsync (on macOS and Linux) or sftp and gzip compression (on Windows) to the remote machine. In return, CLion synchronizes the header search paths to the local machine, in order to perform code resolve quicker and keep the editor more responsive while you work with the code.

The configuration is pretty simple – just create a remote toolchain in Settings/Preferences | Build, Execution, Deployment | Toolchains, and use it in the CMake profiles configured for the project (or make this remote toolchain the default one, to use it automatically):
Remote_toolchain

When this is done, you can compile, run, and debug your application or tests on a remote machine right from CLion. Invoke the commands as usual and have them executed remotely:
Remote_run

For more details on how the remote mode works under the hood, read our detailed blog post. Meanwhile, if you are interested in what we are going to concentrate on going forward, please visit our tracker:

  • Open remote CMake project, so the sources are assumed to be stored remotely (CPP-14584)
  • Remote version system control support (CPP-14482)
  • Remote Terminal Support (CPP-14588)
  • Integration with Valgrind Memcheck (CPP-14178), Google sanitizers (CPP-14179), and CPU profilers (CPP-14357) in the remote mode
  • And other requests linked to the parent one on remote development (CPP-744)

CPU Profiler

CLion now integrates with CPU Profiler on Linux (Perf) and macOS (DTrace). A new action for doing this is available in the navigation toolbar, as well as in the run menu that appears when you click the run icon in the left gutter.

It usually takes some time for the profiler to collect the data. When it’s finished, the notification balloon is shown and the information about the application performance analysis is available in the profiler tool window (View | Tool Windows | CPU Profiler). Tabs with the flame chart, call tree, and method lists provide the information divided by threads. Alternatively, you can see the information from all the threads merged, in one place. You can also jump to the source to explore the code that is causing the performance degradation in your app:
Profiler

Would you like to see any other profilers integrated in CLion? Let us know!

C++ Support

Clangd-based engine: now for navigating through your code

One of our key goals is to make CLion accurate and knowledgeable about modern C++ language features. To inch closer to it, this year we’ve released a new complementary language engine based on Clangd, which works in parallel with CLion’s own language engine and helps with some particular editor features. In the current v2018.2, error and warning annotations were implemented based on Clangd.

In CLion 2018.3, some of the navigation and search actions have been moved to the Clangd-based engine, including Go to declaration/definition, highlighting references under the caret, the Quick Documentation Popup, and Find usages. The results we get from Clangd-based engine are still reviewed and adjusted by CLion, so the two engines still work in parallel to give you the most accurate and reasonable results.

To manage which CLion features are based on clangd, go to Settings/Preferences | Languages & Frameworks | C/C++ | Clangd:
Clangd_settings

The error annotator, Clang-Tidy, and navigation via Clangd are all independent from each other, so you can configure a setup that works best for your projects. By default, Clangd is used for all three; to disable it completely, you have to turn off all three options.

By the way, Clang-Tidy (a famous C++ “linter” tool) is based on clang AST and is available in CLion with or without the Clangd-based engine. The main difference is that when enabled via Clangd, it uses the AST cached by Clangd, which improves performance.

C++17: support for fold expressions and deduction guides

Although we are investing a lot of effort in implementing more IDE capabilities on top of the Clangd-based engine, we still continue improving CLion’s own language engine. As adoption of C++17 grows, we’ve added support for C++17 fold expressions and C++17 deduction guides to CLion’s parser. As a result, code highlighting has become more accurate and code assistance is now even better at understanding your code. For example, types can now be inferred correctly in case of user-defined deduction guides:
Deduction_guides

Unit-testing performance improvements

Improving the editor’s performance and eliminating UI freezes was a major area of focus for us in this release cycle. To improve performance, CLion now uses lazy test detection. This reduces project indexing times in many situations, regardless of which testing framework you use – Google Test, Boost.Test or Catch(2). We’ve already heard some very good feedback from our EAP users who said the editor is now much more responsive.

As CLion now detects unit tests in a lazy manner, we’ve added a special action for diagnostic purposes – “Show Test List”, available from the Find Action dialog. It opens a file with the list of all tests currently detected in the project:
Test_list

If you haven’t started any unit tests in your project or haven’t opened any files with the unit tests, you’ll probably get an empty list, as the action itself doesn’t trigger test indexing. But if you have, you’ll get an appropriate list and will be able to check which tests you’ve actually indexed in the project. If you have ideas on how to improve this feature, please share them with us!

New and updated IDE actions

Build/Rebuild

CLion v2018.3 introduces a new Build menu, which gathers all the build/rebuild/install actions available for a particular project model. For compilation database, it’s only Recompile for a single file. But for CMake, there’s much more:
Build_menu
For example, ‘Build Project’ is a new action which builds CMake all target from all CMake Profiles configured for the current project. To build all target from the particular CMake Profile, use ‘Build All in <selected CMake Profile>’.

You can also rebuild the whole project, the selected CMake Profile (all target), or the selected configuration. The full list of available actions can be found in our web help.

Run Anything and Search Everywhere

This pair of universal dialogs improve your productivity while working with the IDE.

Use Double Ctrl to call Run Anything and launch any prefered configuration – simply type in the name. And if you want to debug this configuration – hold down the Shift key, and the dialog will switch to the Debug Anything mode. You can also use it to open a project – type “Open” and select the desired project from the list.
Run_Anything

Double Shift opens the Search Everywhere popup, which now incorporates several actions at once: Go to class, file or symbol; Find an action, or search all of them at once (Search Everywhere). Use Tab to switch between the different actions. All of the previously available specific action shortcuts still work, so for example, Ctrl+N / ⌘O still opens the Classes tab.
Search_Everywhere

Compilation database scheme compliance inspections

CLion 2018.3 comes with an array of inspections for compilation database json files, which are intended to provide checks on compliance with the compilation database JSON schema. For example, it can highlight situations when an incorrect type is used for the property value, or when the property is missing:
Comp_db_checks

VCS enhancements

IntelliJ Platform, which underpins CLion, has recently introduced several important enhancements to how we work with Version Control Systems. First, Git submodules are finally supported! The IDE now ensures that when you clone a root repository, it will clone all the submodules. The same is true for updates, and other VCS actions work with submodules as well.

Another big change is the new GitHub pull requests tool window (VCS | Git | View Pull Requests). It lists all the pull requests to the repository. You can filter the view by pull request state (for example, state:open), assignee, author, etc. Besides, with a simple right click, you can create a new local branch for any pull request.

Check more about VCS enhancements on IntelliJ IDEA What’s New page.

Editor improvements

Multiline TODO

If you want to store more details in your TODO comments, it’s a good idea to split it into several lines. CLion nows handles this correctly – just add an indent starting from the second line of your multiline TODO comment:
Multiline_todo
The IDE will differentiate the lines started with indent from an ordinary comment, and will highlight it as a TODO comment. In addition, the whole comment text will be presented in the TODO tool windows (View | Tool Windows | TODO).

Macro expansion in Quick Documentation

The Quick Documentation popup (Ctrl+Q on Windows/Linux, F1 on macOS) provides an easy way to understand the code that will be substituted after the preprocessor pass. When called on a macro, it shows the final macro replacement.

In v2018.3, the popup is now properly formatted and the keywords are highlighted. This can be really handy, for example, when dealing with boost macros:
Quick_Doc

Accessibility enhancements

A few new settings are available in Settings/Preferences | Appearance & Behavior | Appearance to make CLion (and other IntelliJ-based IDEs) accessible to as many people as possible. One of it is the brand-new High-contrast Theme.

New Plugins UI

We’ve reworked the Settings/Preferences | Plugins page. Its new UI makes it easier to manage, install, uninstall, and update plugins. You can see the most valuable plugins grouped under Featured plugins, or sort all plugins by rating or number of downloads.
plugins_ui

That’s about it! Try these new features by downloading CLion 2018.3 and starting your 30-day free evaluation. By the way, you can use this demo project from GitHub to check out some of the enhancements. Do give us your feedback, too!

Rust and Swift updates

CLion 2018.3 comes with the Swift Package Manager support in the Swift plugin. Simply open the SPM project in CLion and work with it – no additional configuration required. Read more and watch a short demo.

Rust plugin was updated to get partial Rust 2018 support, Move analysis inspection and Cargo unit testing support.

Download CLion 2018.3

Your CLion Team

JetBrains
The Drive to Develop

Moving into 2019. CLion roadmap

$
0
0

This year’s third big update – CLion 2018.3 – has landed just a few days ago! It’s all about Remote Development, CPU profiling, and better C++ language support.

Following our good tradition, we want to thank those evaluators who have helped us ship so many goodies and still keep the release stable. Our special thanks go to:

  • Oliver Stöneberg
  • Michael Klatt
  • Dmytro Nezhevenko

In appreciation of your efforts, we are giving each of you a free 1-year subscription for CLion (to extend your current subscription or get a new one). You will receive a personal email with details on how to claim your license. If for some reason you do not get an email from us within a week, ping us here in the comments!

Roadmap: CLion in 2019

Our main areas of focus for next year:

  1. Boost performance & eliminate freezes
  2. Wider integration with Clangd-based language engine
  3. Embedded development support

These 3 areas will occupy most of our time and resources and will entail hundreds of various tasks. For example, Embedded development is a huge and diverse area, and our first step will be into the STM32 family of boards. At the same time, it will require lots of changes and improvements in debugger support, project models, and so on. Even if you don’t do Embedded development, you may still benefit from CLion taking this path.

Plan for CLion 2019.1

Note: The following is a preliminary plan; we cannot guarantee that all of the features listed below will be included in CLion 2019.1.
  • Embedded Development
  • Debugger
    • Rework experimental hex implementation
    • Add memory view to CLion
    • Add disassembler view for LLDB debugger (only available for GDB for now)
    • Work on debugger for MSVC on Windows (this might not be finished by the time 2019.1 is released, but some experimental preview will likely be available)
  • C++ support
    • Better indicators related to the Clangd-based engine (in order to measure the memory and CPU usage for this new engine on the user’s side)
    • Wider integration with Clangd-based language engine: the next candidate is syntax highlighting
    • Various bug-fixes in CLion’s own language engine
  • Performance improvements and elimination of freezes: here we plan to focus on memory and CPU usage, investigate deeper first project indexing times and completion performance.
  • Formatter: Clang-format integration
    • In reformat action
    • On the commit stage
    • Automatic Clang-format config detection
  • Project models: continue detaching the API

That’s it! Do you have any new feature requests? Send them to our tracker. We’re listening!

Your CLion Team

JetBrains
The Drive to Develop

CLion 2018.3.1 bug-fix update

$
0
0

Hi,

As you probably know, a big CLion 2018.3 update happened recently. It introduced initial remote development support, CPU profilers on Linux and macOS, and much more.

Today we are happy to announce the first bug-fix update for CLion 2018.3 – 2018.3.1, build 183.4588.63. Get this fresh build from our website, update via Toolbox App, or use snap packages (for Ubuntu). A patch-update will be available shortly.

Download CLion

Bundled Remote Terminal

You can launch an SSH Session right from CLion now. Invoke it via Tools | Start SSH Session, and then configure a new session or select one from the list:
remote_ssh

Other fixes and enhancements:

The full release notes are available here.

Interested to know what’s in the works? See our roadmap for CLion 2019.1.

Your CLion Team
JetBrains
The Drive to Develop

CLion 2018.3.2 bug-fix update

$
0
0

Hi,

Please welcome the second bug-fix update for CLion 2018.3 – 2018.3.2, build 183.4886.39. Get this fresh build from our website or via Toolbox App, or use snap packages (for Ubuntu). A patch-update will be available shortly.

Download CLion

The highlights from this build include:

The full release notes are available here.

Interested to see what we have in the works? Check out our roadmap for CLion 2019.1.

Your CLion Team
JetBrains
The Drive to Develop

Happy Holidays from CLion Team!

$
0
0

Hi all,

The year 2018 is coming to an end, and we’d like to take this moment to have a short look at all the great things that have happened this year in the C++ community and with CLion in particular!

season_greeting_clion

C++ language

Back in 2017, we officially got a new C++ standard, while this year the C++ Committee managed to reach a consensus on many important topics for C++20!

Ranges, Concepts, Contracts, and many constexpr additions were merged into C++20.

The Modules design was approved and now it’s time for the wording specification work! We still have hopes for Modules in C++20, but even getting them in C++23 will be a huge win for the whole C++ community.

There are several proposals being widely discussed this year! Take a closer look if you haven’t read them yet – they are really worth it and will definitely change the way we develop in C++:

C++ conferences and community events

The number of C++ related conferences and community events keeps growing. The pivotal worldwide events such as CppCon, ACCU, C++Now, and Meeting C++ are all evolving, trying new formats, getting bigger, and attracting more and more C++ developers.

CppCon 2018 was huge, bidding a final farewell to Bellevue, Seattle, WA, and awarding Jon Kalb, conference organizer and Chair, for all his fantastic work on making the conference what it is today. The conference tried out some new activities this year – Lightning Challenges, Tool Time, and a new Exhibition format. And of course, as usual, bringing with it a lot of great high-quality C++ content. Get more details in our trip report.

In 2019, several brand new conferences are starting – don’t miss out on joining us at C++ on Sea in the UK and Core C++ in Israel!

CLion

In the CLion team, we rolled out 3 major releases this year, finally bringing to our users Windows Subsystem for Linux (WSL) and Full Remote Mode support, and starting a new complementary language engine based on Clangd. We also added Gradle and compilation database project formats, bundled Databases and SQL functionality, and integrated CPU profilers into CLion. Our plans for 2019 are even bigger!

What is more important, we’ve made the product much more stable and responsive (some issues are still there, but there are fixes planned for 2019). We finally reached 160K developers per month using CLion! Surprisingly, most of them are on Windows now, with Linux in second place and macOS in third. There is also still huge potential to grow and dozens of great opportunities for CLion’s future evolution.

We are happy to have some new members join our CLion family and reveal a few hidden talents in the team:
3F5A0069

We are excited to become more active in the C++ Committee and build an even a stronger relationship with the C++ developers around the globe.

Season’s Greetings from the CLion Team and all of us as JetBrains!


CLion 2018.3.3 bug-fix update

$
0
0

Hi,

A new bug-fix update, CLion 2018.3.3, build 183.5153.40, is now available for download. You can get it from our website, via Toolbox App, or using snap packages (for Ubuntu). A patch-update will be available shortly.

Download CLion

This build has a few important fixes for bugs in different areas:

  • Incorrect “CMake executable not found” error in the case of several WSL toolchains installed.
  • An exception while collecting compiler information from on the remote host (if you’ve experienced CPP-14505 or CPP-14477 errors, please, check if these problems are resolved as well).
  • Build All command was building twice.

Besides, in this build, CLion provides better error indication if the compiler has not been resolved correctly when a compilation database project is used.

Full release notes are here.

Interested in seeing what we have in the works? Check out our roadmap for CLion 2019.1.

Your CLion Team
JetBrains
The Drive to Develop

Live Webinar: Remote Development with CLion

$
0
0

CLion v2018.3 comes with Remote Development support. What is remote development and why is it useful? How does CLion support it?

It’s actually a cloud of activities which different developers can take different parts from, depending on what their goals are. In this webinar, we’re going to look at all these parts, so you know what’s available, and then look at how CLion enables, automates, and simplifies the whole process.

Join us on Thursday, February 28th, 5:00 PM – 6:00 PM CET (11:00 AM – 12:00 PM EST).

CLion_remote

Register now!

Space is limited.

Outline

We’re going to look at some of the remote development topologies that developers work with:

Remote debug (same architecture):

  • Starting with everything local, manually deploying
  • Introducing remote debug using GDB server
  • Syncing files

Remote debug (different architecture)

  • Cross-compilation with CMake

Full remote:

  • Building, running, and debugging over ssh
  • Running and debugging tests remotely
  • Developing in a remote context (e.g. with platform-specific symbols)
  • WSL (Windows Subsystem for Linux)

Different hardware:

  • Remote development on Raspberry Pi, as an example

Speaking to you: Phil Nash @phil_nash
Developer Advocate for C++, Objective-C, and Swift tools at JetBrains. Prior to that, he worked in such diverse fields as finance, agile coaching, and iOS development. A long-time C++ developer he also has his feet firmly in C#, F#, Objective-C, and Swift – as well as dabbling in other languages. He is the author of several open source projects – most notably Catch: a C++-native test framework.

Please register now to reserve your seat.

CLion opens 2019.1 EAP: ClangFormat, Disassembly View for LLDB, and support for injected languages

$
0
0

Hi,

Today we are thrilled to begin the CLion 2019.1 Early Access Program! The first build is already available for download. As usual, you can download build 191.4212.38. from our site, using Toolbox App, or through a snap package (if you are using Ubuntu).

Download CLion 2019.1 EAP

The main highlights (as you probably already got from the title) include:

CLion 2019.1 EAP

ClangFormat support

CLion’s own formatter works as you type and it provides you with several predefined code styles like LLVM, Google, or Qt. There are also dozens of other flexible options that you can use to configure your code to your personal preferences. However, in the C and C++ world, there is a widely used tool for formatting the code, which some call the standard. It’s called ClangFormat. And it’s now supported in CLion! Let’s take a look at how you can use it.

Open a project in CLion with .clang-format file in it

If your whole team is using ClangFormat it’s natural that you should use it as well, especially since the config file is likely already present in the project repository. Besides this, many open source projects nowadays include a .clang-format config with the project source code. In cases where ClangFormat is used, when you open the project for the first time in CLion (and open any C/C++/Objective-C file in the editor), the IDE detect it and it will suggest that you switch to ClangFormat:
ClangFormat notification

Another possibility is that you manually invoke Enable ClangFormat for project from the code formatting switch at the bottom of the editor at any time:
ClangFormat in action

Another option is to turn it on in Settings/Preferences | Editor | Code Style (this will affect all the projects you are working on in CLion):
ClangFormat global setting

Review the ClangFormat options applied to a particular file

It’s possible to have several different ClangFormat settings inside one project: for example, a library used in the project, uses one style, while a user’s code is done in a different style. If this is the case, then there can be several .clang-format configs in the project. To better understand which style affects while file, CLion provides a quick and easy way to review all the ClangFormat settings applied in particular file – simply call the “View ClangFormat options for ” action from the toolbar switcher when the necessary file is opened in the editor:
ClangFormat settings

Tip: If you don’t have a .clang-format configuration file yet, you still can switch to ClangFormat in CLion using the toolbar switch or the IDE settings. LLVM style will be used in this case and you can review ClangFormat settings in the IDE.

These settings are currently read-only. We’ll add the ability to change and export them later (CPP-15184).

When is ClangFormat used?

Naturally everywhere in the IDE where you have code to format:

  • While typing in the editor
  • When calling the Reformat Code action for a selected piece of code (Ctrl+Alt+L on Windows/Linux, ⌥⌘L on macOS):

Format with ClangFormat

  • When reformatting the code before a commit (pre-commit hook), if a commit is done via the Commit action (Ctrl+K on Windows/Linux, ⌘K on macOS)

Known limitations:

  • It’s not possible right now to import/export settings between CLion’s own formatter and ClangFormat (CPP-4805).
  • ClangFormat only works for C, C++, and Objective-C.
  • A few other issues linked to the parent ticket CPP-4809.

Debugger: Disassembly View

LLDB users will be happy to learn that bundled LLDB (on macOS and Linux platforms) was updated to 7.0.1 in this build. And more importantly, Disassembly View now works for LLDB as well!

Disassembly View was updated for both backends: GDB and LLDB, and now it shows information per function:
Disasm for LLDB

Please note, CLion still doesn’t provide Disassembly View on demand (CPP-9091), which means that it only works after you force the step into functions with no source code. As a workaround, feel free to use a nice 3rd party plugin known as Compiler Explorer (hopefully, it will soon be updated to work with 2019.1 EAP).

Injected languages

When coding in C and C++, there can sometimes be pieces of code inside string literals. Wouldn’t it be nice if an IDE could treat them as code, and not as text? For example, SQL strings, HTML code, or Regular Expressions. Well, it’s now possible in CLion! To temporarily inject a language, press Alt+Enter and apply the intention “Inject language or reference”, select the appropriate language, and you are done!
Injected SQL

CLion provides accurate code highlighting based on the language chosen, it also has language-specific intentions, actions, and it can edit a code fragment in the dedicated editor section functionality. For example, for regular expressions you can check if a string matches the RegExp right in the IDE:
Injected regular expression

This injection is temporary, which means it will be removed when you restart the IDE restart or reopen the project. And of course, you can un-inject manually using the Alt+Enter context menu.

An update for plugin writers

When you are missing any functionality in CLion you may create a feature request or consider implementing a plugin using IntelliJ Platform API. In our plugin repository, there are more than 1.2K plugins for CLion (check this selection of valuable non-bundled plugins). We have simplified the process of building CLion’s plugins by publishing CLion as a Maven dependency to be used by gradle-intellij-plugin (since version 0.4.2). In simple terms, this Gradle plugin adds the specific IntelliJ-based IDE dependencies, helps with preparing plugin.xml files and preparing the proper structure for the plugin, executes the IDE instance with the plugin you are developing, and finally, it also helps with uploading the plugin to the plugin repository. And starting with 2019.1 it’s aware of the CLion SDK.
We do hope to make some help articles on the CLion specifics, which will be available here shortly, and we welcome anyone who wants to create a plugin for CLion to check it out!

Other enhancements

Since 2018.2 CLion uses an additional Clangd-based C++ language engine for showing code errors and warnings in the editor and some navigation and search actions. In this EAP we’ve improved the errors messages and take more details from Clang:
Detailed clang errors
These details, for example, might be very useful when you debug failed overload resolution in your C++ code.

This EAP brings new inspection which reports the member functions that can be marked as static:
Member function can be static

If you are using compilation database project model in CLion, you’ll be interested to learn that CLion now allows you to build/clean such projects. Just configure external tools and provide them in the settings as build/clean commands:
comp_db_build

And finally, there are also notable VCS improvements coming from the IntelliJ Platform. Thanks team!

That’s it. Full release notes are here. Download and try the EAP build right now and let us know what you think!

Download CLion 2019.1 EAP

Your CLion Team
JetBrains
The Drive to Develop

CLion 2019.1 EAP: Code highlighting with Clangd, Mute Variables in Debugger, and more

$
0
0

Hi,

Here comes a new CLion 2019.1 EAP, build 191.4738.15! You can get it from our site, using Toolbox App, or through a snap package (if you are using Ubuntu). The patches will be available shortly for those of you who are using the previous EAP build.

Download CLion 2019.1 EAP

Clangd: code highlighting and quick-fixes

In 2018, we announced that we would work towards a complementary Clangd-based language engine and shared our big hopes for it. First, we implemented the error annotator on top of Clangd. Later came Clangd-based navigation and search (for some actions). And the first 2019.1 EAP starts with ClangFormat support, which we also kept as a part of Clangd. Now we’ve expanded the engine with code highlighting and quick-fixes!
llvm_highlight

For users, this means editor performance improvements. For code highlighting this change is clear, but for quick-fixes, it requires a bit of explanation. The Clangd-based language engine is used to identify potential breaches in the code and show an error or a warning. Now it’s also used to provide a location for a quick-fix, while CLion covers the actual quick-fix:
Quick-Fix

Unfortunately, for various reasons, some of the quick-fixes have been removed temporarily. You can find a list of them in the tracker: CPP-15243. We’re doing our best to fix the regression and put the most valuable quick-fixes from this list back in before the release. Make sure you let us know if your favorite one is on this list!

Clangd memory indicator

There is an increasing amount of functionality working on top of the Clangd-based language engine in CLion (mostly configured in Settings/Preferences | Languages & Frameworks | C/C++ | Clangd). Meanwhile, we plan to investigate the memory usage of the engine and turned on the memory indicator for the memory used by the Clangd-based engine in this EAP:
clangd_memory
We might turn it off by default later, but for now let us know if you observe any suspicious usage there. (Besides, as a workaround, if you click on the indicator, CLion will restart the daemon.)

Mute variables in Debugger

While you are stepping through the code in debugger, the variables are calculated and the values are shown in variables view in the debugger tool window and right in the editor (Inline Variables View). There are cases, however, when it’s more important to step quickly and only watch the variables occasionally. So to improve the stepping performance in such cases, we’ve added an ability to Mute Variables. Most important facts about this new feature:

  • General per-IDE setting: the switcher is located in the context menu in the debugger tool window and mutes values calculation for all projects and all current and consequent debugger sessions (for both, GDB and LLDB). To unmute, turn off the setting.
  • Load values: each variable in the variables view gets a Load option. Click it to load the particular variable’s value at current step. The value won’t be recalculated on the next step.

mute_var

Other improvements

A very useful fix has found its way into this build finally – now when you do a file rename, CLion doesn’t rename an associated class/struct silently, but asks instead if you’d like to rename it. And for sure, it works the other way round:
rename

That’s it. The full release notes are here. Download and try the EAP build right now! We are looking forward to your feedback!

Download CLion 2019.1 EAP

Your CLion Team
JetBrains
The Drive to Develop

CLion 2019.1 EAP: naming conventions

$
0
0

Hi,

Here comes a new CLion 2019.1 EAP build 191.5532.20! Get it from our website, Toolbox App, or via a snap package (if you are using Ubuntu). The patch will be available shortly if you are using the previous EAP build.

Download CLion 2019.1 EAP

Naming Convention

Naming is a non-trivial decision every developer makes daily. It can improve the readability of our code or ruin it completely. This is why naming conventions have been created: to help developers follow standard paths when selecting names for various identifiers such as global/local variables and functions, types, parameters, classes, and so on. Known libraries, game engines, and other notable pieces of code usually follow some predefined schemes their authors agree on and recommend that all contributors use as well (if the project is open source).

We’ve recently asked our followers on Twitter: “Which naming styles do you usually use in your C++ projects?”. The answers were very diverse; here are just a few:
naming_arne
naming_tweet2
naming_tweet3

The reason we asked is, obviously, our desire to improve CLion and help our users keep the preferred naming convention. This EAP showcases our first steps in this direction.

We keep listening to your feedback on Twitter and in our issue tracker (check the subtasks under CPP-15439) and plan to improve this area further before the 2019.1 release.

Let’s see what great new things you can do in CLion!

How to configure? Code Style settings

A new tab is now available in Settings/Preferences | Editor | Code Style | C/C++, called Naming Convention. Here you can configure the preferred style for namespaces, macros, classes, enums, functions, parameters, etc.
naming_settings

You can select the style (lowercase, camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, or UPPERCASE). You can also set a custom prefix or suffix (for example, you can use ‘E’ as a prefix for all Enum types).

Most likely we’ll be adding more options here – for example, it’s already obvious that template parameters are currently missing (CPP-15445). Note also that the settings are global per IDE for now. If project-wide settings are important to you, feel free to up-vote CPP-15446.

You can also select the naming style (and other code style settings) from the predefined scheme:
naming_scheme

Note that these schemes are used for indents, spaces, and other formatting options at the same time, so not all of them actually include any naming rules. We may add more schemes in the future.

How does CLion respect the naming style?

CLion respects the naming settings provided and uses them in the following features:

  • Autocompletion.
  • Code generation, including live templates.
  • Extract/Inline function and Introduce define refactorings.
  • Quick-fixes which generate code, such as add parameter to constructor, change function signature according to call, and some others.

naming quick-fix

In addition, if you’d like CLion to enforce a naming convention more actively, turn on the new Inconsistent Naming inspection (Settings/Preferences | Editor | Inspections | C/C++ | General). CLion will highlight the problematic names and will suggest a quick-fix to replace all usages with a more accurate name:
naming quick-fix

Other improvements

More notable changes in this EAP build include:

  • For those who use Remote Development mode in CLion, IPv6 is now supported. Please check the corresponding ticket (CPP-14264) for details on how to enable it.
  • CMake 3.13.4 is bundled.
  • We do recommend that our users use the experimental Clangd-based language engine (turned on by default). However, if you experience any issues with it, you can now easily turn it off: use Enable clangd server in Settings/Preferences | Languages & Frameworks | C/C++ | Clangd. And please don’t forget to report any issues you encounter with all the logs to us.

That’s it. The full release notes are here. Download and try the EAP build today. We are looking forward to your feedback!

Download CLion 2019.1 EAP

Your CLion Team
JetBrains
The Drive to Develop

Viewing all 681 articles
Browse latest View live