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

CLion 2017.1 EAP: Disassembly view, Catch support and MSVC changes

$
0
0

Hi,

Last week we announced experimental support for the Visual C++ compiler in CLion. This week brings more exciting features, like disassembly view for debugger and Catch test framework support! A new EAP build, 171.3691.13, is now available for download. And you will get a notification about a patch-update in case you are using the previous EAP build (171.3566.4).


Download CLion 2017.1 EAP

In this EAP:

Disassembly view for debugger

This build brings disassembly view for debugger. You can now step into disassembly code, when the sources are not available. The assembly code will be highlighted correctly and you can then step though it to investigate the problem:
disasm
As work on this feature is not yet finished, there are a couple of limitations and known issues:

  • It now works only with GDB (for LLDB support, please, follow CPP-8908)
  • Setting a breakpoint in the assembly code in not possible (CPP-8910)
  • Run to cursor (CPP-8945) and evaluate expression (CPP-8952) are not yet there

Try the disassembly view on your project and let us know what you think in our tracker.

Catch

This EAP brings Catch support to CLion. Catch is a cross-platform test framework for C++ which you might consider as an alternative to Google Test, CppUnit and others due to following reasons:

  • To start you just need to include catch.hpp and that’s it! No external dependencies are used and it’s just a single header
  • Write test cases as, self-registering, functions or methods
  • Cases can be organized into sections, BDD-style Given-When-Then sections can be used

And now there is one more reason – CLion’s Catch support!
catch
It includes:

  • Built-in test runner to inspect the results with ease: check the progress bar, test status and test duration, the whole test output stream, and more
  • Catch run/debug configurations in CLion
  • Completion for tags in the configuration settings

CLion support Catch v1.7.2 and higher. To learn more about Catch itself and its support in CLion read this blog post by Phil Nash, the original author of Catch and developer advocate here at JetBrains.

MSVC fixes

The previous EAP build introduced experimental support for the Visual C++ compiler in CLion. It’s now possible to build projects with MSVC/CMake/NMake toolchains on Windows. A few fixes and usability changes were added this time:

  • If you were using VM option to turn on the MSVC support, please, revert it back (remove custom VM options file from configs) and use Registry: in Find Action dialog (Shift+Ctrl+A on Linux/Windows, ⇧⌘A on macOS) type Registry; open Registry and type msvc:
    registry_on_msvc
  • VS 2013 is now also supported (in addition to VS 2015 and VS 2017)
  • CLion now auto-detects the Visual Studio versions installed on the machine
  • Navigation through compiler errors was introduced (links to the code were added, as well as navigation to the previous/next error):
    messages
  • CMake settings for MSVC were updated with some hints for the possible values:
    settings_hints

That’s it! The full release notes are available here.


Download CLion 2017.1 EAP

The CLion Team
JetBrains
The Drive to Develop


To Catch a CLion

$
0
0

catch
CLion is a cross-platform IDE for C++ development (which happens to have a built in test runner).

Catch is a cross-platform test framework for C++.

I’m the original author of Catch and am now working at JetBrains so this seems to be an ideal match! As of the 2017.1 release (or since EAP 171.3691.13) I’m pleased to say that CLion fully supports Catch as a first class test framework. That means you can create Catch test runner configurations that let you specify test names (with wildcards) or tags, see the results of your test runs, hierarchically, in the test runner window, and can re-run failing tests, or the test where the cursor is, with just a single shortcut. You can even run all tests in a source file.

But why would you want to use Catch in the first place? In the post I’ll take you through using Catch with CLion’s new integration and give you a flavour of what to expect.

Getting and using Catch

Catch is distributed as a single header file, with no external dependencies (beyond the C++03 standard library). You can always get the latest version of this header directly at this URL.

Or you might prefer to clone the whole repository from GitHub. That will also give you the docs, tests, scripts and source files that get used to build the single include. If you do this you’ll find the single header file in the single_include directory.

Once you have the file you just need to drop it into your project directory – or somewhere else on your include path. Because Catch is a single header you can directly include it in your own repository.

Now to use it just include the header in your test files. Additionally, in exactly one source file you’ll also need to precede the #include with either #define CATCH_CONFIG_MAIN or CATCH_CONFIG_RUNNER. The former instructs Catch to define main() for you, and will take care of parsing command line arguments and exit codes. Use the latter identifier if you want to supply your own main(). There are then several levels you can hook in at. See the documentation for more on that.

#define CATCH_CONFIG_MAIN
#include "catch.hpp"

To start a test case just use the TEST_CASE macro and give it a test name – as a freeform string. Optionally give it a second string containing one or more tags in square brackets. Assertions are usually REQUIRE – which aborts the test on failure, or CHECK – which reports the failure but carries on. For more details on these macros and more see the documentation.

Within a REQUIRE or CHECK just use normal C++ comparison operators. Catch uses expression templates to decompose the expression so it can report the left-hand-side and right-hand-side operands independently.

Here’s an example of everything we just discussed:

int theAnswer() { return 6*9; }

TEST_CASE( "Life, the universe and everything", "[42][theAnswer]" ) {
  REQUIRE( theAnswer() == 42 );
}

Notice that Catch test cases are modelled as free functions. There is no need to create a “test fixture” class (although that is supported too). Instead, tests can be organised by dividing top level test cases into sections. You can even nest sections within each other, or use the BDD style bindings that give you GIVEN-WHEN-THEN blocks. For more see the docs on test cases and sections

If you build and run this now it will use the default console reporter to give a textual report on the results. This already works quite nicely. But to take advantage of CLion’s Catch integration you just need to add a unit test configuration.

add-catch-config

Go to Run | Edit Configurations (or from the configurations drop-down at the top-right) and click the + icon at the top left of the configurations dialog. Select Catch Test from the drop-down and give it a name (e.g. “Unit Tests”). There are some more options here but that’s all you need to start using Catch with CLion’s test runner.
Click OK and, now, running the tests will open the test runner tool window.

Fully Integrated

The left-hand pane shows a hierarchical representation of all the tests that have been run. You can hide or show passing or ignored tests with the green and orange icons at the top, as well as various sorting and folding options.

failing-test

When you click on a test name you’ll see the output from the test on the right. Or if you double-click you’ll also be taken to the start of the test case in the code. Where file and line numbers appear in the output you can click there to go to individual assertions in the code (especially useful if you have many assertions, or they are not directly in the body of the test case).

By default only failing tests have detailed output. But Catch has a command line option to force passing tests to show output, too. Edit the configuration again and in, Program Arguments write -s. Run the tests again and now output is shown for all tests, pass or fail. Catch has a rich set of command line options which, again, can be found in the docs.

Being selective

The test runner gives you several options for running your tests. With the editor caret inside a test case, Pressing ^⇧R on a Mac, or Ctrl+Shift+F10 on Windows/ Linux (or use the the option from the context menu) will run just that test – or press ^⇧D/ Ctrl+Shift+D to debug it. If the caret is outside any particular test case, but still within a test file, the same command will run all tests in the file. (Note that whenever you selectively run tests using one of these features a new, temporary, configuration will be created and selected. Remember to select your main test configuration to run all tests again).

re-run-catch

And if you just want to re-run all test that failed in the previous run you can do that too. Just click the Rerun Failed Tests icon in the tool window.

If you want even more control over which tests are run go to Edit Configurations again. Here you can select tests by Tags / Test or Pattern.

With the first option selected the next field is Tags:.

catch-tags

Start typing tag names (in square brackets) here and you’ll get completions right in the text entry field! For our example, start typing [t and you’ll
immediately be offered [theAnswer]. You can select more than one tag to narrow the set of tests further.

With one or more tags selected the Test: field becomes active. This is a dropdown of all tests matching the current tags. You can, optionally, choose a specific test from this list – or just leave it to run all matching tests. It can also be handy to just drop down this list to reassure you that the tags are selecting the set of tests you think they should be.

Alternatively, if you set Test kind: to Pattern and go to the Pattern: field, you can write a test name, or part of a test name with a * wildcard at the beginning and/ or the end to match one or more tests.

catch-pattern

About time

catch-sorted

To the right of the Test Results hierarchy are timings for each test, as well as groups of tests. If you’re writing simple unit tests it’s likely these timings will all be rounded to 0ms. But in the case of longer running tests it can be useful to keep an eye on these numbers. One of the sorting options is “by duration”, which can be helpful to see where the time is going if your tests are taking too long to run, for example.

catch-export

Further along the toolbar are icons for exporting and importing with test results. They can be exported as Html or Xml reports, saved to a file. Reports exported this way can later be imported, of course. But if you click the Import Test Results icon you’ll see that it also lists your recent test runs – which have automatically been saved (temporarily) for you.

catch-import

This can be useful if you want to remind yourself what state you were in earlier and fits nicely with CLion’s Local History feature (under VCS | Local History) for getting back to earlier versions of your code – independently of using a fully-fledged version control system. CLion automatically saves a snapshot of your changes every time you run and, with test integration, automatically labels each test run with pass/ fail status.

catch-local-history

Catch up

So CLion’s Catch integration gives us more conveniences in how we run our tests, as well as a rich set of viewing and reporting options. Altogether this can make us more productive and offers a faster feedback loop – all important in testing practices such as TDD and BDD.

Catch itself has many more features than we have touched on here, so do be sure to read the docs, maybe starting with the tutorial.
You might also want to follow my personal blog where I often write about Catch.

CLion 2017.1 EAP: nested namespaces and various fixes

$
0
0

Hi,

New CLion 2017.1 Early Access Program build (171.3780.24) is now available for download. You will get a notification about a patch-update in case you are using previous EAP build (171.3691.13).


Download CLion 2017.1 EAP

It’s time for C++17!

Great news! We’ve started C++17 support in CLion. Nested namespaces can now be correctly resolved and highlighted in CLion:
nested_name

GDB timeout

Some GDB operations may require longer time to execute. To avoid unnecessary timeouts in CLion, you can set an option in Registry: in Find Action dialog (Shift+Ctrl+A on Linux/Windows, ⇧⌘A on macOS) type Registry; open Registry and type cidr.debugger.timeout:
debugger_timeout
This is added as a workaround for the issues like CPP-8842 and CPP-9010, until CPP-7906 and CPP-4504 are ready.

Python

If you are using Python in your C++ project, you’ll be glad to know, that an annoying issue with the interpreter setting (reseted by CLion on restart) is now fixed.

Other fixes

There is also a couple of regressions fixed, including:

  • Expression result unused for stream operators for auto parameters (CPP-8949)
  • Lambda return type is not deduced correctly with type aliases (CPP-8861)

Full release notes are available by the link.

CLion 2016.3.4

Another bug-fix update for CLion 2016.3 is now available as well. From C++ side it includes a fix for an incorrect code analysis warning about ‘<<' applicability (CPP-8300). There is also a list of platform issues.

The CLion Team
JetBrains
The Drive to Develop

CLion 2017.1 Release Candidate

$
0
0

Hi,

Today we are glad to announce CLion 2017.1 Release Candidate (build 171.3780.43). As we are approaching the final steps towards the CLion 2017.1 release, we kindly ask you to share your feedback and comments with us and report any bug at all to our tracker.


Download CLion 2017.1 Release Candidate

If you use GCC as a compiler and have precompiled headers in your project, you’ll be glad to know that since now CLion can correctly resolve symbols from PCH in this case (CPP-8729).

Release notes are available by the link.

Your CLion Team

JetBrains
The Drive to Develop

CLion 2017.1 Release Candidate 2

$
0
0

Hi,

CLion 2017.1 is just around the corner, and today we are rolling out CLion 2017.1 Release Candidate 2 (build 171.3780.103). Give it a try, and if you find any bug at all, please file an issue in our tracker.


Download CLion 2017.1 RC2

Please note that to use CLion 2017.1 RC2 you need to have an active subscription (or start a 30-day evaluation period).

CLion 2016.3.5

We are also rolling out CLion 2016.3.5 update (build 163.15188.10). Check the release notes here.

Your CLion Team

JetBrains
The Drive to Develop

CLion 2017.1 released: C++14, C++17, PCH, disassembly view, Catch, MSVC and more

$
0
0

Please give a warm welcome to CLion 2017.1!

CLion_20171_1000x500

Our first big update this year includes:

Download CLion 2017.1

Modern C++ standards

As C++17 has already been approved, we’ve sped up to support the latest C++ standards. The following features of C++14 are recognized in v2017.1:

  • auto return type,
  • generic lambdas,
  • variable templates, and
  • generalized lambda captures.

Support for these language features includes correct highlighting and no false-positives in code analysis, as well as correct code completion, navigation and refactorings. For example, earlier you couldn’t get the code completion in the case below as CLion was not able to correctly infer the type of vec variable:
cpp14_auto_return
Now this works fine in CLion.

This means that only constexpr is actually missing from C++14. As for C++17, we’ve started with the most upvoted feature, nested namespaces.
cpp17_nested_namespaces

There are dozens of fixes for incorrect code resolve and thus no more false code analysis and other related issues. Check out the build to see if CLion got better for you!

Support for C++11 and C++14 will be polished in 2017.1.x and 2017.2 releases, and hopefully we’ll be able to devote more time to C++17.

Make auto

While working on modern C++ standards, developers see how new language features can help make their code more accurate and readable. What if an IDE could assist you with the task of modernizing your code? Sounds good, doesn’t it?

The first step we’ve taken in this direction is to add a ‘convert variable type to auto’ intention in CLion 2017.1. Just put the caret on the type or variable name, and invoke the available intentions list with Alt+Enter:
Make auto intention

Be careful – keep the code modern, but self-documented. The best general cases to convert variable type to auto are iterators, type casts and new-expressions.

Precompiled headers and more

Precompiled headers and the -include compiler option is a way to reduce compilation time and keep large-scale codebases structured and clear. When using this, you simply compile expensive includes once and then guide the compiler to reuse that information.

CLion 2017.1 correctly resolves symbols from such headers, suggests code completion, navigate to the declarations and definitions.
PCH

Check more details.

Debugger

The debugger in CLion 2017.1 received several important bug fixes and a workaround for the GDB timeout issue (which unfortunately still happens to some CLion users).

However, the most important and long-awaited change is the disassembly view in the debugger. When the sources are unavailable, you still can step into and view the disassembly code. Step through it to investigate the issue in your program deeper or to understand what’s happening inside a library call.
Disassembly view

For now this only works for GDB. For more about the limitations and known issues, see this.

Besides, if you just open a .s or .asm file in CLion (or other extensions, if you add them to Settings | Editor | File Types | Assembly Language) which uses the AT&T dialect and no preprocessor, it will be appropriately highlighted in the editor.

Catch

There are lots of unit test frameworks for C++: Google Test, Boost, CppUnit, CppTest and many more. Catch is one that’s known for its easy starting process (just include a simple header) and convenient and flexible test cases.

CLion has had Google Test support for a while, and now we’ve introduced Catch support. It includes a built-in test runner that allows you to view the test results and sort them by duration, rerun failed tests, export test results, navigate instantly to the source code, etc.

Catch

The special Catch Run/Debug configuration is flexible enough to run any preferred set of tests within CLion. For your convenience, it provides you with completion of Catch tags and wildcard-based matching templates to speed up configuration.

catch_completion

To learn more about Catch and how it’s supported in CLion, read this detailed blog post.

Microsoft Visual C++ compiler

One more feature that many of our users have requested is support for Microsoft Visual C++ compiler.

There are three important things you need to know if you’d like to try it in CLion:

  1. Use the Registry option clion.enable.msvc to enable this support (in Find Action dialog (Shift+Ctrl+A on Linux/Windows, ⇧⌘A on macOS) type Registry; open Registry, type clion.enable.msvc to search for the settings and turn it on).
  2. CLion supports Microsoft Visual C++ compiler that ships with Visual Studio 2013, 2015 and 2017.
  3. There’s no support for msbuild. CLion works through CMake with the NMake generator. Besides, debugger is not yet supported.

msvc_release1

CLion auto-detects the Visual Studio versions installed on your machine; provides settings to configure the Microsoft Visual C++ compiler path, architecture and platform; and finally runs Microsoft Visual C++ compiler to compile your program. It also helps with navigation through the compiler errors in the Messages Build tool window.

It’s important to understand that this support is currently experimental, meaning there are known issues, the biggest being that there’s no support yet for specific Microsoft C++ language extensions. We will continue to work on it within the 2017.2 EAP.

Find in Path

In CLion it’s possible to search for text across the whole project or any selected scope, with the Find in Path dialog (Shift+Ctrl+F on Linux/Windows, ⇧⌘F on macOS). Now it has a popup window with immediate preview, though you can still open a separate Find Window if you wish:
Catch

VCS: enhanced log view and branches popup

CLion 2017.1 enhances its Log View, making search easier with regular expressions and the ability to match/ignore case.
match case in log viwer

If you have lots of branches in your project and are afraid of getting lost in them, mark the most important ones as Favorites. The redesigned branches popup then allows you to filter them and view only the favorites.

Swift and other plugins

If you are looking for a Swift IDE on Linux, check the Swift plugin for CLion. Thanks to the AppCode team, it now comes with important enhancements that make development in Swift easier:

  • Create new project wizard provides ability to create Swift projects
  • SourceKit-based inspections and intentions are available in the plugin
  • Generate type and initializers from usage

Swift

Besides, Go plugin was updated and now correlates with Gogland functionality.

That’s it! Explore all the new features in more detail on our website and watch this overview video:

To play with the new features, check our special repository that we maintain in order to illustrate changes in CLion 2017.1 in a very code-centric way.

Start your 30-day free evaluation and check all the new features and fixes.

Download CLion 2017.1

Your CLion Team

JetBrains
The Drive to Develop

All systems are go: CLion 2017.2 roadmap

$
0
0

Hi,

It’s been a week since we released our first big update this year – CLion 2017.1. We’d like to thank you all for your warm welcome and useful feedback. If you haven’t tried it yet, do it today! There are lots of goodies like C++14 and some C++17, disassembly view, Microsoft Visual C++ compiler, Catch and many more.

All systems are go, and we’re moving on to 2017.2.

Special thanks

To follow a good tradition, let us first thank those who helped us in the early stages as we ran the 2017.1 Early Access Program. We’re rewarding the following contributors whose input was the most valuable in this release cycle:

  • Andrew Somerville (Twitter handle: catskul)
  • Rohan Joyce (YouTrack handle: rfjoyce)
  • Jean-Marc Bourguet (YouTrack handle: bourguet@cadence.com)
  • Matt Godbolt (YouTrack handle: mattgodbolt)

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

What you can expect from CLion 2017.2

After analyzing the feedback and the current state of CLion, we’ve decided to dedicate the upcoming release to various fixes, cleanups and improvements to current functionality. That doesn’t mean nothing new could finally join the release, but our focus will be shifted more into this direction.

Note: The following is a preliminary plan; we cannot guarantee that all of the features listed below will be included in CLion 2017.2.
  • C++ support
    • Continue with C++17. Check the list of supported language features in our webhelp
    • Fix false-positives in code analysis, which are mostly caused by incorrect code resolve
    • Modernize code transformation actions (like code generation or some intentions) so that modern C++ standards are in use
  • Microsoft Visual C++ compiler support
    Started as an experimental feature in 2017.1, this will be evaluated and get wider adoption in CLion:
    • Microsoft language extensions support
    • Support for precompiled headers (that currently works for GCC and clang)
  • Debugger
    • Continue working on the disassembly view in debugger:
      • force step into action (CPP-8978) to avoid jumping into the disassembly when not expected
      • disassembly view for LLDB (CPP-8908)
      • disassemble on demand (CPP-9091) to cover cases when the sources are available, but the disassembly view is still required
    • Hex formatting for numerical variables (OC-2305)
    • Debug as root (CPP-7224)
  • Project model
    This is still going to be CMake. Please see the section below explaining our plans regarding other build systems. In 2017.2 we will mainly address the following:
    • Make toolchains settings configurable per project / per configuration (not per IDE as it is now). This will cover environment, CMake settings, compiler, debugger, etc. (CPP-8893)
    • MSYS support (CPP-2275)
  • Performance
    Unfortunately it’s hard to promise something specific here, but we 100% sure to dedicate some additional time to this task. Our current plan is not only to continue working on investigating user-submitted snapshots, but also to implement a set of index and other optimizations.
  • Others
    Other planned tasks include fixes related to unit testing (for both Google Test and Catch), macro formatting, fixes for some current issues with the Python support plugin, and more.

Looks like we’ve packed quite a lot here, so let’s see what we can really achieve until July or August, which is when the actual release is planned.

No makefiles?

Sorting the tickets in our tracker by votes, we find some clear winners – Makefiles and remote toolchain support. As you’ve been asking about our plans on these, we’ll address them here to make our planning process clearer and explain our choices.

The immediate answer, as you can see from the roadmap, is No. We are not planning any of these task for 2017.2. However, the eventual answer is Yes… after we resolve some other issues.

Let’s talk about Makefiles. It all boils down to the experience we would like to offer to the users of CLion. Originally we made the choice to use CMake as a main project model and we believe it was the right decision. Thanks to all the help and support from our community, we’ve made huge progress since then. But we are not yet satisfied with the level of support and usability of CMake integration and would like to improve it, before we move further and add support for Makefiles and other build systems.

The major planned CMake improvements are:

  • Ninja generator support,
  • configuring CMake defaults,
  • canceling CMake generation process.

This will also be considered for 2017.2 and 2017.3.

Also, since one of CLion’s main strengths is being a cross-platform IDE, we would like to offer Windows support on par with Linux/macOS. That means CLion needs to work with Microsoft Visual C++ compiler as effectively as it works with GCC or Clang. We already started working on this, and will continue to do so in the next release cycle.

Implementing Makefiles support will require additional work around the project model and indexing. Since Makefiles do not directly list headers, first we need to find a solution for problems related to non-project headers (CPP-263, CPP-270).

These are the main tasks we would like to finish before implementing Makefiles support, though there might be additional smaller ones. Since we cannot predict how long they will take, we can’t give you an ETA. But please rest assured that Makefiles is on our radar and we believe it will be an important addition for CLion as a cross-platform C/C++ IDE.

This is it! Stay tuned and don’t miss the EAP launch for 2017.2.

Your CLion Team

JetBrains
The Drive to Develop

CLion 2017.1.1 EAP

$
0
0

We are glad to announce the start of Early Access Preview for CLion 2017.1.1, a bug-fix update to the recently released major CLion update. Build 171.4073.32 is now available.

You can download the build and install it side by side with the stable version of CLion. Please, note that this EAP build requires an active subscription (or you can start a 30-day evaluation period).


Download CLion 2017.1.1 EAP

This build addresses the following issues:

  • Fonts were poorly rendered on Linux (check the full JRE release notes)
  • Lots of fixes for the false-positives, like for example:
    • Override specifier in local class was highlighted as syntax error
    • Local class type was not resolved properly inside member functions
  • Several issues with Catch, including the the problem with running tests via the context menu, if the caret is located inside TEST_CASE_METHOD

Python

Some of our users experienced a crash after update caused by a conflicting Python plugin installed. First of all, we’d like to apologize for the inconvenience and confirm that we are working on a solution to prevent such problems in the future. Also, please, make sure that “Python Community Edition” plugin (from the repository) is not installed for you and remove it if it’s still the case.
If you can’t start an IDE to remove it, remove the following folders:

  • For Linux: ~/.CLion2017.1/config/plugins/python-ce
  • For Windows: C:\Users\user\.CLion2017.1\config\plugins\python-ce
  • For macOS: ~/Library/Application\ Support/CLion2017.1/python-ce/

Correct Python support plugin for CLion is called “PyCharm Community Edition for CLion” and it goes bundled with CLion.

Full release notes are available by the link.

By the way, if you are interested in our plans for 2017.2 check this blog post.

Your CLion Team

JetBrains
The Drive to Develop


CLion 2017.1.1 update is available

$
0
0

Hi,

CLion 2017.1.1, the first bug-fix update for the recently released major version is now available! If you haven’t yet upgraded to CLion 2017.1, good time to do so right now.


Download CLion 2017.1.1

If you’re using CLion 2017.1, a patch-update will be available shortly.

This update addresses poorly rendered fonts on Linux, fixes to false-positives in code analysis and some Catch related issues. Full release notes are available here.

And if you are looking forward to 2017.2, check the blog post with the roadmap.

Your CLion Team

JetBrains
The Drive to Develop

C++ Annotated: Jan – Mar 2017

$
0
0

Today we are happy to share our next compilation of C++ news with you.

Subscribe to the regular C++ Annotated and be the first to get the next edition!

C++ Annotated: January – March 2017

In this edition:

C++ in 2017

The C++ ecosystem

logo-sunThis blog post about the C++ ecosystem in 2017 is worth a special mention. Written in January, it overviews nicely the main expectations and trends, and not just about the language. While C++17 is indeed the main topic for this year’s discussions (as well as the features that failed to be included and so postponed for the future), it is also about adopting new standards and libraries, and of course the community including user groups and conferences.

C++17

cpp_17As C++17 is approved, pending national body comments, there are lots of resources now where you can find the final feature list, explanatory code samples, committee meeting live threads and committee meeting trip reports. This list by Bartlomiej Filipek is quite useful as it provides code samples for each feature, lists the key compilers (GCC, Clang, MSVC) explaining the versions where the feature is supported, and links to various additional articles. It’s very detailed and includes every small change.

News

Toggles in functions

non_cpp_toggles
A tricky problem with bool-typed toggles in functions is covered by this blog post. What at first glance looks like a readability issue, can actually grow into a bug especially inside some overloaded methods. The post discusses several solutions, including one proposed by the blog author.

Clang-tidy: easy start

libclangClang-tidy is the topic of regular blog posts, lightnings and even big conferences talks, like the one recent at C++ Russia 2017. Indeed, it’s a quick and easy way to get an analysis of your code base and even apply some fixes instantly.

If you’d like to try Clang-tidy, this blog post is a good place to start. Sharing a basic example where code modernization is needed and some cases with missing override attributes, it goes through the setup instruction step by step and teaches you to run a single check, apply a fix, and analyze the whole project (taking into account all the compile flags, etc.).

Continuous integration with C and C++

cpp_ci
The challenges of CI for C and C++ are covered in this Conan blog post. It starts by explaining the C and C++ building processes, showing how the build systems can help with the incremental build. Then it goes on to binary management questions and incremental build complexity with regards to CI. The benefits of Conan Package Manager in this area are also mentioned, including re-build logic, profound dependency management, a way to specify build order of dependencies, and so on.

Inserting elements into STL container

fluent_cppIn his blog, Fluent C++, Jonathan Boccara discusses the problem with inserting several elements into an STL container efficiently. This provides an interesting overview of std::back_inserter and std::copy. The main idea is that knowing the size of the data to be inserted can help a lot in your optimization tasks.

Refactoring principles

simplify_cpp
Arne Mertz is well-known for his Simplify C++ blog and especially his series of posts about code refactorings. This time he writes about the basic refactoring principles – sounds philosophical, but they’re very useful in practice. What are these principles? In a nutshell, go with small steps that you can compile, test and commit; select a direction from the very beginning and follow it, postponing not-related changes; and don’t be afraid to break code styles, duplicate code and do other things that you usually try to avoid, if that is really necessary as an intermediate step in your refactoring procedure.

Readable modern C++

readable_cpp
At the end of February, Timur Doumler joined C++ Russia 2017 and the Saint-Petersburg C++ user group meetup to talk about readable code and especially readable modern C++. The talk highlighted the general principles, like naming conventions, the necessity of comments, and eliminating code redundancies. Timur also put forth his ideas on how to make C++ more readable with the latest standards (from C++11 to C++17). The meetup version of the talk was recorded and is available on YouTube (with slides). He also delivered this talk at the C++ London meetup group.

Concepts

concepts
This is no rocket science but a simple example of when Concepts could be beneficial. The article starts from a very simple arithmetic code sample, eliminating the compilation issues one by one. But then, it adds Concepts and gets all of them at once. Sounds good, doesn’t it? Concepts are not coming to C++17 (they still require more work and polishing in details), but that doesn’t mean you can’t start thinking about where it makes sense to adopt them in your code base.

To Catch a CLion

catch-hand-iconCatch is a cross-platform test framework for C++. It is known for its easy setup – only a single header is required, and no external dependencies are needed. Not to mention easy-to-use test cases, which are designed as self-registering functions or methods and can be divided into sections.

While this framework is not as popular as Google Test or Boost Test, it’s seeing more and more interest from the community. Phil Nash, the author of Catch, is now working at JetBrains as a developer advocate and has already influenced integration into two (out of three) C++ tools by the vendor, ReSharper C++ and CLion. This article in the CLion blog shares some useful tricks around its integration into CLion and the use of the framework itself.

The future of the C++ job market

stats
If you feel like discussing the C++ job market and its future, go ahead and join this thread on reddit, but first invest 5 minutes into reading this article from Bartlomiej Filipek. Why? It offers a nice summary of the areas where C++ is currently applicable and lists the language’s advantages. It also gives advice for newcomers and summarizes the results of a Twitter poll on whether the C++ job market is stable, decreasing or growing.

emBO++

emboIn case you are interested in embedded development, you’ll be glad to learn about a new conference dedicated to it, entitled emBO++ and driven by Odin Holmes. This year the talks covered Standardese (so called next-generation Doxygen), clang tooling for embedded systems, profiling and many more topics. Listen first hand to Odin at CppCast, a developer who is really keen on microcontrollers. The discussion covers his general impression, an overview of the audience, and of course technical specifics around embedded development.

Compiler Explorer goes Patreon

compiler_explorerCompiler Explorer is a great online tool for seeing what your C++ code compiles down to when various compilers are used. Matt Godbolt, the author and maintainer, has now opened a Patreon page for the project, primarily to cover the hosting costs. It has also given him momentum to accelerate ongoing development, at least for now, so do check it out.

Releases

CLion

CLion_400x400_Twitter_logo_whiteCLion 2017.1 was released at the end of March with nearly full support for C++14 (now only constexpr left), nested namespaces from C++17, precompiled headers support, disassembly view in debugger in case of GDB, support for the Catch test framework. There is also experimental support for the Microsoft Visual C++ compiler, so if you are not a fan of MinGW (MinGW-w64) or Cygwin, that’s something good for you to try out in CLion.

The CLion team also announced the preliminary roadmap for 2017.2, coming later this year. The plan is to focus on bug fixing, performance improvement and polishing of the existing functionality. Check it out in CLion’s blog.

ReSharper C++

R++_400x400_Twitter_logo_whiteReSharper C++ 2017.1 brought support for Visual Studio 2017 and CMake projects, extended the list of supported postfix templates, and added some new options in formatting. It also came with lots of enhancements for inspections and code cleanup tasks. For more details see the ReSharper C++ site.

Visual Studio

vs_cppTalking about Visual Studio 2017, we should mention improvements in its code analysis, including C++ Code Guidelines checkers. Example include marking objects as const unless you are writing to them, marking objects as const if passed to a function that doesn’t modify them, and using constexpr for values that can be computed at compile time (and same for functions).

Besides, Visual Studio 2017 supports several C++ compilers to serve various needs and use cases: MSVC, Clang, and GCC.

Qt Creator

qtQt Creator 4.3 Beta was announced in late March. In terms of CMake support it now comes with CMake server, which is an alternative way to get project information (instead of parsing the generators output). It also supports different contexts for file parsing and experimental Clang-based rename refactoring.

 

That just about covers it for March. Talk to you later!
The C++ Team

CLion starts 2017.2 EAP with Clang-Tidy integration

$
0
0

Hi everyone,

CLion_20172EAP@2x_splash
Great news – CLion 2017.2 EAP starts now!
We had a lot of work planned for this iteration, and especially one thing that was nearly ready for 2017.1 but got postponed in the end as it required more thoughtful development and testing. Today as a part of the 2017.2 EAP (build 172.1572.3), we give you Clang-Tidy integration!


Download CLion 2017.2 EAP

As usual, you can install it side by side with your current stable CLion version, with no active subscription required.

Please note that EAP builds have been moved to the site for easier search. The confluence page is now obsolete.

Clang-Tidy

Why Clang-Tidy?

As you may know, CLion has its own code analysis tool on board. It runs on the fly, showing warnings as you type and suggesting quick-fixes for detected issues. Built-in code inspections provide checks for unused code, the order of declarations, incompatible types, redundant casts, and many other issues. So why do we need Clang-Tidy? Here are some important reasons:

  • Clang-Tidy is a great tool that provides dozens of valuable checks. Some of them overlap with the CLion’s inspections, while other are unique. The tool also provides quick-fixes in addition to checks.
  • Clang-Tidy is easily extendable, with a convenient API for writing new checks.
  • The list of Clang-Tidy checks now includes checks for the C++ Core Guidelines, which we want CLion users to benefit from.

How it works

Clang-Tidy is now seamlessly integrated into CLion, meaning it simply works as you type in the CLion editor. Clang-Tidy warnings are shown the same way as CLion’s own built-in code inspections. Similarly you can use Alt+Enter to apply Clang-Tidy quick-fixes where available:
ct_modernize

CLion uses its own Clang-Tidy fork, which we are going to make public later. We’ve improved the output format and implemented support for response files passed through the command line. These changes are subject to backporting to Clang-Tidy master (the patches will be prepared soon). When either of the above is done, users will be able to create their own custom Clang-Tidy-based checks in CLion.

Clang-Tidy integration works on all platforms including Linux, Windows and macOS. As for compilers, currently it works for GCC and Clang; MSVC, which is supported in experimental mode for now, has not yet been tested with Clang-Tidy.

ct_google

Settings

Clang-Tidy checks are enabled by default in this EAP build, and are shown as warnings in the editor. Not all the checks are enabled, however; find the default configuration description here. You can customize them in Settings/Preferences | Editor | Inspections | C/C++ | General | Clang-Tidy:

  • Switch on/off Clang-Tidy checks as a whole.
  • Set a severity level (Warning by default) for all the checks at once.
  • Configure the list of checks to enable / disable in text form, by using the Clang-Tidy command line format.

For example, let’s run only C++ Core Guidelines checks on the project. Pass the following line in the settings: -*,cppcoreguidelines-*:
ct-settings

This will result in only C++ Core Guidelines checks running on the project:
ct_cppcoreguide

For Clang Static Analyzer checks, use: -*,clang-analyzer-*. For modernize checks, use: -*,modernize-*. And so on.

The full list of Clang-Tidy checks can be found on their site. CLion’s default configuration is described at our confluence page.

Future plans, known issues and your feedback

There are many things that are not yet there for Clang-Tidy integration:

  • A UI for configuring Clang-Tidy checks is still up for discussion.
  • There is a noticeable delay after a quick-fix is applied and before the warning disappears (CPP-9204).
  • Because the current .clang-tidy formats and options are not supported, the checks that use them are turned off by default.
  • There may be possible bugs in Clang-Tidy itself.

We hope to address the biggest problems in time for the 2017.2 release. Your feedback, typical usage scenarios and probable issues with Clang-Tidy integration would be very helpful! Please share them in our tracker or in the comment section below.

And more

Other important changes include:

  • Previously only targets linked with gtest were automatically producing Google Test Run/Debug configurations in CLion. Now gmock is working in the same way as well (CPP-6146).
  • In case there is an unused variable, CLion will suggest you to remove it. In addition, starting from this build new quick-fix was added to preserve non-trivial constructor call on unused variable:
    unused_constr_quick_fix
  • A bug with Rename refactoring renaming another variable with the same name is fixed now (CPP-7251). This also covers the case when name stays in generalized lambda capture (CPP-9286).

Full release notes are available here.


Download CLion 2017.2 EAP

Your CLion Team
The Drive to Develop

C++ team on the move! ACCU, C++Now and Sweden C++

$
0
0

Hi,

As the CLion 2017.1 release has just passed and the Early Access Program for 2017.2 was opened recently, we are now ready for some travel!

ACCU, C++Now and Sweden C++ are planned for April and May 2017.

ACCU 2017, Bristol, UK, April 26-29

We’ll be happy to show you CLion, AppCode and ReSharper C++ demos, answer any questions, share tips & tricks and just chat about C++ development at our booth. Get a free yoyo from us, solve a quiz to get a nice T-Shirt or fill the survey to win a license! And by the way, we’ll have lots of stickers for your laptops.

Besides that we have two talks on the main conference schedule:

Anastasia KazakovaA look at C++ through the glasses of a language tool by Anastasia Kazakova

With its history going back to the early days of programming, rich heritage, tons of legacy code mixed with modern language features and patterns, quickly evolving language standards, and a variety of tools in the environment, C++ can be tricky and easily enable hacks and inaccurate solutions if you don’t cook it right.

Developing language tools (and IDEs in particular) is a good litmus test for such problems. When a tool gets confused by some code or fails to provide the full intelligence it’s supposed to possess, doesn’t that mean that developers should also pay more attention and be more careful in the same situations? This talk is dedicated to bringing such situations to light and sharing lessons learned.

Read more

Phil NashFunctional C++ For Fun And Profit by Phil Nash

C++11 gave us lambdas in the language for the first time (if you ignore boost::lambda) – so it’s a functional language now, right? There’s a bit more to functional programming than having first class function objects. I’d even argue we still don’t quite have that. But does that mean we can’t do functional programming in C++? Yes. No. Maybe…​

Read more

C++Now 2017, Aspen, CO, USA, May 15-20

We won’t have a booth there, but you can catch a few team members at the event to ask questions, chat about products and more.

There is the same talk by Anastasia Kazakova planned for C++Now. While Phil is doing a different one:

The Holy Grail – A Hash Array Mapped Trie for C++ by Phil Nash

There exists another general purpose data structure that combines many of the characteristics of trees and hash tables into something that in many important ways is superior to both, and with minimal downside (they are close but not quite as fast as pure hash tables). Hash Array Mapped Tries are more memory efficient than hash tables and, as a bonus, are trivially made persistent – with big implications for concurrency, functional programming, and other applications that benefit from being able to treat them immutably (as well as share large amounts of common state in memory at once).

Read more

Sweden C++ User Group, Stockholm, Sweden, May 22

And finally, if you are in Stockholm or near, join the evening at King.com and learn more about CLion. Anastasia will present at the user group meetup:

Can you make me more productive with a C++ IDE? by Anastasia Kazakova

Writing code at the speed of thought and having the IDE take care of all mundane development tasks – that’s what productivity means for us at JetBrains. But is it even possible for a tricky language like C++?

In this talk we’ll explore CLion, a cross-platform IDE for C and C++ development.Come and learn how to save your time and generate tons of code in one click, move members up/down the hierarchy, or change the signature of a function safely. Find out how to catch and fix errors by performing static code analysis on your C/C++ code base, which identifies unused and unreachable code, runs type checks and performs data flow analysis. Check out the benefits of integrated Google Test, Catch, and various Version Control Systems.

Finally, we’ll overview the plugin repository to see what goodies it offers to CLion users.

Register for the event

And there will be even more!

See you,
The JetBrains team

CLion’s quick tour updated to celebrate 2 years!

$
0
0

Hi everyone,

CLion is two years old—a big toddler! Over this time we’ve boasted an impressive user base growth of almost 400%, which has given us all the confidence in the world to continue and improve.

Remember what CLion was capable of when you joined us? Some things have stayed unchanged, for example CLion is still CMake-only, even though CMake smart support has evolved greatly. But the rest has been impressively enhanced:

  • Support for C++14, initial support for C++17, and C11 keywords
  • Code generation options for operators and lots of new and improved code inspections & intentions
  • Microsoft Visual C++ compiler experimental support
  • Doxygen
  • Clang-Tidy (2017.2 EAP)
  • LLDB on Linux and macOS, remote GDB debug, and attach to local process
  • Disassemble view
  • Google Test and Catch
  • Python support
  • Updated Go plugin, plugin for Swift (covering Linux), Remote Host Access, and others

Did I leave out your favorite feature? Most likely I did.

It’s a good time to update our Quick Tour Video now. Phil Nash, our developer advocate, did a great job and prepared a new recording. Check this fascinating monster story:

What do you expect from CLion in the next two years? Share in the comments below! We’re listening and it sure will be interesting to see how things develop 😉


Download CLion

Your CLion Team
The Drive to Develop

ACCU 2017 trip report

$
0
0

Hi,

We’ve just returned from ACCU 2017 in Bristol, UK. Being amazed by the event I decided to share some notes here, and hope Phil will also jump in and share his impression. There are also reports by Vittorio Romeo, Simon Brand and Samathy Barratt which you might find interesting.

JetBrains booth and my talk

We’ve decided not to break the good tradition started in 2015 and as usual had a booth for Wed-Fri. We’d like to thank everyone who came for a chat or just to say hello:
accu1

My general impression was so much different from the one in 2015 (I skipped 2016 for family reasons). Back in 2015 it was just one week after the CLion 1.0 release, so not that many were familiar with JetBrains as a whole or any of our C++ products (CLion, ReSharper C++, AppCode). We mostly gave intro demos and explained who we were and what we did.

This time was totally different! Most of the attendees had heard about our tools (that felt great!) and many of them had tried them. So our conversations revolved around particular use cases, new features and plans. And of course we shared our new Clang-Tidy integration.

One thing that I noticed in particular was that relatively few people are aware of our free trial program. If you simply go to our site, you’ll find CLion’s build (stable release or EAP, depending on your preferences) to download and use free for 30 days. If your company requires longer evaluation, simply drop us an email to sales@jetbrains.com and we’ll process it quickly.

Attendees were also interested in refactorings our tools provide, and we really have a lot. Get a free trial to try them all on your project!

Luckily I had my talk on the first day, which then helped me relax for the rest of the event. I talked about the C++ language and how we see it as tool developers. The topic seemed to resonate with many, and attendees found this new view interesting and useful. At least they liked my samples with similar lines which mean different things depending on the context:
talk_sample_play

The video is already available, and you can find the slides here.

Conference in general

Because of the booth and my own talk, I unfortunately was not able to listen to many. However, I made some good choices and caught a few very interesting topics. Considering that most of the talks were recorded, I feel good about how it all went in the end.
accu_keynotes

Mongrel Monads, Dirty, Dirty, Dirty

How do you usually handle errors in C++? Niall Douglas was talking about various options here: from enums to optional and expected and much more. The sample he built his talk around was a frequently used open-file-by-name case. So Niall iterated, showing various solutions to the task. What I found most valuable was the performance measurements that showed how badly the solution with exceptions fails. His own outcomes solution was also quickly introduced. The video is already available, so find more details there.

Lightning: LLVM C/C++ compiler frontend in Java

As you might guess, this one was extremely interesting to us as a C++ IDE creators. We already had some discussions about it with Vladimir Voskresensky at the Saint Petersburg user group that I currently run. The full version of the talk was presented at LLVM Europe 2017 and the recording is already available. At ACCU Petr Kudriavtsev made a short presentation. However, you could still get the idea.

Treating clang as the powerful tool it is, but considering the potential issues when using it from inside a Java-based IDE (Java-C++ bridging overhead, safety, etc.), the NetBeans team decided to try another way and ported clang into clank, a Java version of clang. An interesting fact is that they’ve got a tool that is capable of translating clang’s patches into clank code with minimal manual work required. While there is some performance degradation and the adoption is not wide inside NetBeans (only in preprocessor for now), this is still an interesting solution. We are currently also playing with several options on how to generally improve our C++ parser and we’ll definitely follow NetBeans team work at least out of curiosity.

5 years creating FOSS dev tools for C and C++: the untold

The talk was presented by Diego Rodriguez-Losada, a person who we should thank for Biicode in the past and Conan now. Despite the fact it was not that technical, but rather a set of advice from personal experience, I still found it interesting. I was definitely glad to see CLion on many slides. We indeed try to keep the tool lock-in to a minimum, so that you can rely on well-known toolchains instead of learning and sticking to another new one created by another tool vendor.

C++ Core Guidelines – Modernize your C++ Code Base

Peter Sommerlad dedicated his talk to the C++ Core Guidelines, overviewing the sections and talking about the most important ones. If you haven’t read the Guidelines document at GitHub yet, take this talk as a good introduction to the topic. Learn about the general ideas behind the Guidelines and see some sample of when they are important. We of course also waited impatiently for the demo, as Cevelop is now capable of performing some checks from the Guidelines on the code. While we currently support them mostly via Clang-Tidy (and some checks are available in our own implementation for some time already), Cevelop has taken another approach and implemented them in its own parser engine. I’ve got some good ideas like introducing const to the code that we might have in CLion as well.

Grill the C++ committee

The session with the committee was great. We learned how the committee feels about C++17 and things not coming into it (seems that, while they are satisfied with many additions to the standard, Modules, Concepts and Ranges are still the biggest demand for C++20 or however it will be called). Again it was explained how to start with a proposal, and Herb Sutter encouraged everyone to try. Moreover, the session recording is already up on the ACCU YouTube channel.

Over to Phil

I also only had a chance to attend a few of the talks. Unlike Anastasia’s, my talk was on the final day, so I spent more of my time preparing for that. Nonetheless I still thoroughly enjoyed the conference – both in the sessions, and in the after-session socialising. I’ve been an active member of the ACCU since around 2000, and have been to all but one of the last 15 years of conferences, speaking at most of them. Catching up with old friends has always been an enjoyable part of the conference, but it’s easy to fall into the trap of inadvertently excluding others who are not already part of your group. Usually I consciously try to break away from that at times and meet new people. This year the JetBrains booth gave me another great way to do that – but one of the emergent sub-themes of the conference was that of going even further to be inclusive and, for most of us, our blindness toward the very real problems in this area. These thoughts are captured far better than I could ever put them in Samathy’s blog post that Anastasia linked to at the start, as well as a lightning talk that Andy Balaam gave, and also blogged about here.

On a more technical note I caught some of the same talks as Anastasia, but also a few different ones. First up was Nico Josuttis’ talk on “The nightmare of Move Semantics for Simple Classes” which showed just how challenging it can be to take advantage of perfect forwarding in a relatively simple case. Fortunately he finished with a few helpful rules of thumb that will give you reasonable defaults for most cases.

I also learnt about “Functional Programming for the Web with Elm”, by Austin Bingham, which was a great introduction to a language that is at once both far removed from the C++ center of gravity of the conference, but also familiar as we adopt more and more functional idioms (just see my talk). It certainly beats JavaScript!

Admittedly the first talk I was able to give my full attention to (without fiddling with my slides, or at least thinking about my own talk) was the first one after mine – the last of the conference before the closing keynote: Odin Holmes’ “Modern C++ Design reloaded”, wherein he took us through the main topics from Andrei Alexandrescu’s famous book and revisited in the context of what we think of as “Modern C++” today. Some things are no longer relevant or are much easier to do (e.g. variadic templates instead of typelists), some have fallen out of favour (singletons, policy-based smart pointers) and some just have newer, generally nicer, ways of doing things. One big shift has been away from TMP (Template Meta-Programming) towards metaprogramming being supported as a first class (as opposed to “accidental”) feature of the language. But Odin also argued that there is still a place for some of the older techniques – especially in the embedded domain.

Back to Anastasia

Closing keynote by Herb Sutter: Thoughts on Metaclasses

I managed to listen to only one keynote session, but it was so incredible that it really was worth it! I’m not sure if Herb really wants us to talk about it widely for now. The recording will be made public only after the proposals are presented to the committee (which definitely makes sense), but let me share the main idea here.

If the proposals are accepted, we might get metaclasses, we might avoid boilerplate code via talking to the compiler in code, we might get DSLs out of C++ without vendor-specific compilers, and much more. Moreover, clang is already catching up with these proposals!
Intrigued? You should be! But keep calm and wait for the committee to react (fingers crossed!).

There were more, but I’ll stop here and let you wait for the recordings available. Find them at YouTube: Day 1, Day 2, Day 3, and Day 4. And I certainly recommend that you join the ACCU 2018. The dates are known (2018-04-11 to 2018-04-14) so you can already save them in your calendar.

Your CLion Team
The Drive to Develop

CLion 2017.2 EAP: CMake 3.8, code analysis fixes, and more

$
0
0

Hi,

It’s been a while since we’ve started CLion 2017.2 Early Access Program. We’d like to thank those who has already given it a try and shared the feedback on the newly added Clang-Tidy integration.

This new EAP build (172.2103.9) comes with a set of fixes and improvements, as well as IntelliJ-platform wide enhancements.


Download CLion 2017.2 EAP

CMake

CLion checks the configured toolchain by compiling a simple program and providing you with the results under Preferences/Settings | Build, Execution, Deployment | Toolchains. CLion now shows the diagnostic for the cases when errors happen. Click error label to open CMake Errors window:
cmake_error

Besides, CMake 3.8 was bundled into CLion.

Code analysis improvements

This build includes a couple of fixes for various code analysis false-positives:

  • Error in analysis of full specializations from variadic templates (CPP-7313)
  • Incorrect analysis of function that take parameter pack arguments and non-template arguments (CPP-7336)
  • Incorrect “Call to … is ambiguous” for member function vs. function in foreign namespace (CPP-9240)

Find in Path enhancements

In CLion 2017.1 a compact popup window with immediate preview was implemented for Find in Path. Now it has a left gutter, where you can see navigation icons and local change markers:
find_path_gutter

There were some requests to keep this popup window visible, even after the user switch focus back to the editor. So now to close the popup you have to press Esc.

Better HiDPI support on Windows

Instead of scaling IDE’s UI according to the global settings (primary display), CLion now provides each display with its own scale factor. This is done for Windows, Linux support is coming. Also font settings are adjusted automatically based on the display resolution.

Full release notes are available here.


Download CLion 2017.2 EAP

Your CLion Team
The Drive to Develop


CLion 2017.2 EAP: debugger fixes

$
0
0

Hi,

A new early access build for CLion 2017.2 (172.2273.4) is available.

Debugger improvements

While inspecting arrays during debug, you might notice there was a limit of 50 elements shown by default. To see more user had to explicitly expand the next 50 elements. This was done to reduce performance issues. However, sometimes a few elements with big indexes are needed, and it’s quite tiresome to click expand several times in a row.

In order to provide a solution to the problem, we’ve added a registry value to control the default number of composite value’s children:
max_children

A few other issues were resolved in CLion’s GDB driver:

  • Debugger showed command time out when trying to attach to a non-existent local process.
  • Backslashes in program arguments on Windows were escaped incorrectly.
  • Conditional breakpoints were disabled because of the GDB bug (CPP-9336). A workaround was implemented in CLion.

Includes paths on Windows

Includes paths on Windows were fixed to support absolute paths, paths with multiple backslashes and paths related to the root of the working disk.

Find full release notes here.


Download CLion 2017.2 EAP

Your CLion Team
The Drive to Develop

CLion 2017.2 EAP: code analysis fixes

$
0
0

Hi everyone,

We are glad to announce that new CLion 2017.2 Early Access Preview build (172.2465.12) is now available. Download it from our site or get a patch-update if you are using previous EAP build.

This build addresses the following issues:

  • Incorrect code analysis when std::enable_if is used (CPP-3632, CPP-9281).
  • For GCC5/6 CLion failed to resolve STL containers with nested template type correctly in case “using namespace std” was used. That caused incorrect no matching function and other errors when accessing container’s member.(CPP-8638, CPP-9412, etc.). Please.
    note, for MinGW-W64 & GCC 6.3 the problem is still there (CPP-9796).
  • Incorrect “Declaration of const variable requires an initializer” in case of a static const field (CPP-1145) or constexpr (CPP-9340).
  • Out of memory issue (regression) when the code uses boost::property_tree.
  • Git Revert command is now available in the Git Log view. Select any number of commits and call Revert from the context menu.
    revert_git

And there is more! Check the full list by the link.


Download CLion 2017.2 EAP

Your CLion Team
The Drive to Develop

CLion 2017.2 EAP: better VCS support

$
0
0

Hi,

A new CLion 2017.2 EAP build (172.2827.9) is now available.

From C++ side this build includes some exception fixes and bundled CMake 3.8.2. Besides, there is a bunch of improvements to VCS support in CLion.

Commit messages

Commit messages are part of a team communication process, so it’s important to keep them easy-to-read and expressive, and formatting is quite important here. You might want to have a blank line between subject and body, or set a maximum text length, and for sure check the spelling in the comments. Reworked and moved to a separate page under Version Control, Commit Dialog settings allow you to do exactly that:
version_control_settings
Commit messages inspections are accompanied by quick-fixes to reformat the text.

Reword

If you committed your changes but not pushed yet and would like to change the commit message, you can do this with the new Reword action:
reword

Check the full release notes here.


Download CLion 2017.2 EAP

Your CLion Team
The Drive to Develop

C++Now trip report by JetBrains

$
0
0

It’s been a while since C++Now 2017 wrapped up in Aspen. As it was my first C++Now, I took some time to think it over before sharing my impressions. By the way, there are other trip reports: by Ben Deane, Michael Park and Odin Holmes.

In a few words, it was a fantastic opportunity to dive into cutting-edge C++, and hopefully survive. That means not only successfully escape from a major storm in Denver and Aspen’s snowy weather, but also meet dozens of clever people and dive into crazy ideas and libraries, that will become your everyday C++ routine tomorrow.

IMG_5316

One exceptional thing about C++Now sessions, which makes this conference unique in comparison to CppCon, Meeting C++ and others, is a drive for discussions and collaboration. JetBrains is a C++Now video sponsor this year and, together with Bash Films, we make sure you’ll get high-quality video content from this year’s conference. Still, many valuable points will unfortunately be lost as they could not be recorded. Only there, high up in the Aspen mountains, could you experience:

  • Live discussions during the talks
  • Free-time discussions
  • Library-in-a-week activity and work on proposals going on day and night (sometimes literally!)

C++ developers come to Aspen to contribute to the language, work on libraries that may later be included as a part of the standard, evaluate various proposals implementations, and suggest bright and revolutionary ideas and solutions to other developers.

For us, a tool vendor, this was a great opportunity not only to get a glimpse into how the language is evolving, but also to understand how to enhance our tools now so that they best work for C++ developers tomorrow.

IMG_5036

std2

In particular, I’d like to share my impression of Alisdair Meredith’s talk about std2 (part 1, 2, part 3 is not yet available). It took three sessions and became more and more interactive with each one. Some ideas that I was very happy to hear:

  • Modules-based approach, meaning that each header is replaced with a single import and deprecate headers. A good point up for debate is whether it’s better to go with one std module, a module per header or some intermediate balanced approach with modules per piece of functionality (work with streams, text-handling, various algorithms, etc.).
  • Concept usages, which is good on its own but raises a big question on how to proceed with existing constraints and avoid pure concepts vocabulary in std. There is also the question of eliminating type traits with concepts and reflection.

Another good question about new namespace was raised: Is it possible to have two co-existing top-level namespaces? Is it possible to import symbols from one into other?

Alisdair discussed compatibility questions with the audience and suggested some additions. What we met in Aspen was a better but still compatible std, which we may expect to try in C++20 and delivered by C++23.

Reflection

Jackie Kay gave an exciting talk about reflection. For the end user, reflection opens up fantastic possibilities, while for the tool vendor it brings more or less pain depending on the implementation. I was very interested in the range of options, from the currently available schema-based generation, compile-time generation with libclang, and reflection macro like one from Boost.Hana and more, to some fresh suggestions like reflexpr and operator$/cpp3k.

I especially liked that the talk was full of samples which helped understand the suggestions better, as well as see some obvious and nonobvious pros and cons in each case. If you’d like to experiment with the solutions and see some benchmarks, check out Jackie’s repo at GitHub.

CMake

CMake was my primary build tool before JetBrains, and it’s currently the only project model in CLion. Still it’s possible to surprise me with some CMake-related talk. Case in point: Daniel Pfeifer’s talk on modern CMake was regarded as the Most Educational talk. A short summary of Daniel’s advice:

  • Modern CMake is not about variables (which are easy to break, because you’ll get an empty string as soon as you make a typo in the variable), but about targets and properties, which are safer and you can work with them as if they were objects (in OOP sense).
  • Don’t use commands that operate at directory level.
  • Don’t use CMAKE_CXX_FLAGS, but better specify requirements and let CMake figure the compiler flags to use, as it’s the safer way to go.
  • Use a Find Module for 3rd party libraries that do not support clients to use CMake (like Boost). Others provide packages that can be included by using Find Package (even when they are not using CMake for their own build, like Qt).

Daniel also talked about CTest, CPack and some code analysis tools, and really impressed me with a list of directions in which CMake can theoretically evolve in the future (that was Daniel’s personal wish-list but I do really support many ideas from there):

  • PCH as usage requirements, so that CMake takes care of building the PCH and force-includes this header to the compilation units.
  • Allow things like Protobuf, Qt-resources and other IDL to be treated like a language by CMake.
  • Lua VM (execute CMake commands on Lua VM and allow CMake modules written in Lua).

Lightning talks

I was impressed by lightning talks as well. They were both fun and educational, and I even think that two 2-hour evenings are not enough; a third day of lightnings would be a great addition. By the way, we played this cute joke during lightnings:IMG_5292

There are of course lots of other bright talks I recommend watching; most of the recordings are already available. You may want to start with the talks recognized as this year’s best.

Over to Phil

It was also my first C++Now and I can attest to most of Anastasia’s first impressions. It’s a unique conference in so many ways: the setting, the people, the sessions, the after-sessions – even the accommodation (it’s a spa resort, if you stay on campus).

Of course in terms of content it was top-notch. This is primarily an experts-to-experts exchange (having its roots in BoostCon), and it shows. It’s not that the material is necessarily all too advanced for the average developer. Most of it was surprisingly accessible. But for many speakers (myself included, on this occasion) it was an opportunity to share what we’re doing or what currently interests us – often as a “thinking out loud” exercise where we invite active discussion and feedback – knowing that some of the best minds in the community are around.

Highlights for me were Tony Van Eerd’s “Postmodern C++” which was entertaining but also thought provoking in part; Peter Bindel’s “Mocking C++”, which pulled out all the stops in abusing the language to achieve what many thought was impossible in C++; and Mark Zeren’s “Rethinking Strings” which dovetailed nicely with some of my own thoughts that I have been presenting as part of my Functional C++ talks. Unfortunately I missed many that I had been looking forward to seeing as I was still spending a lot of time getting ready for my own talk, including: “constexpr ALL the things” (Jason Turner and Ben Deane), and “Postmodern Immutable Data Structures” (Juanpe Bolivar). It was sad leaving Aspen behind.

IMG_5081

Next week I’ll be at NDC Oslo and the Italian C++ conference in Milan the weekend immediately after, giving three talks between them (“Functional C++ for Fun and Profit”, twice, and “Swift For The Curious”) and working at the booth in both locations. So if you’re around, please do come and say “Hi!”.

(now back to Anastasia)

CppChat

Jon Kalb also recorded a special episode of his CppChat during the event. It was a great gathering of people (and I was happy to join!) who discussed their impression of this year’s C++Now. Conference volunteers and speakers were happy to share their thoughts and give reasons for visiting C++Now.

Weather, deer and the mountains

I had been told of the wonderful mountains views in Aspen, but what I saw really impressed and delighted me.

IMG_5212

I was prepared to see some bears, but instead met deer early in the morning near my hotel room. It has to be Spring in the mountains, but temperatures fell down during the after-lunch talk on Wednesday and it was snowing until Friday. Still, I enjoyed the warmed open swimming pool:

IMG_5257

You may expect anything from C++Now, but one thing is for sure – there you’ll find great content and lots of new friends among highly professional C++ developers who care about the future of the language.

Live Webinar: Developing C/C++ projects with CLion IDE and Conan C/C++ package manager

$
0
0

This webinar will provide an introduction to developing large C/C++ projects using the package modularization and reuse offered by Conan package manager, and the power and convenience of the CLion IDE, using the CMake build system.

It will be demonstrated how to consume existing packages of popular C and C++ libraries like Poco, Boost, OpenSSL and ZLib, easily from the CLion environment. Then, how to create package will be explained, with a special focus on continuous development of packages from your own, evolving source code.

Join us Wednesday, July 11th, 4pm – 5pm GMT (6pm – 7pm CEST, 9am – 10am PDT).


Register now!

Space is limited.

About the presenters:

Diego Rodriguez-LosadaDiego Rodriguez-Losada
 
Diego’s passions are robotics and SW engineering and development. He has developed many years in C and C++ in the Industrial, Robotics and AI fields. Diego was also a University (tenure track) professor and robotics researcher for 8 years, till 2012, when he quit academia to try to build a C/C++ dependency manager and co-founded a startup. Since then he mostly develops in Python. Diego is a conan.io open source C/C++ package manager co-creator and maintainer, now working at JFrog as SW engineer and C/C++ advocate.

 

Luis Martinez de BartolomeLuis Martinez de Bartolome
 
Luis is a full stack software engineer with more than 13 years of experience. He has spent the last 5 years mitigating the pains of C/C++ development flows & dependency management. Co-founder of Conan and a proudly Frog 🐸, today spends his time developing Conan and its ecosystem, playing ukulele, growing hydroponic lettuces and enjoying his two kids.

 

Please, register now to reserve a seat.

Viewing all 678 articles
Browse latest View live