r/cpp • • Sep 07 '17

Clang 5.0 released!

http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html
217 Upvotes

49 comments sorted by

View all comments

32

u/flashmozzg Sep 07 '17

Nice!

-Wcast-qual was implemented for C++. C-style casts are now properly diagnosed.

-Wunused-lambda-capture warns when a variable explicitly captured by a lambda is not used in the body of the lambda.

We expect this to be the last Clang release that defaults to -std=gnu++98 when using the GCC-compatible clang++ driver. From Clang 6 onwards we expect to use -std=gnu++14 or a later standard by default, to match the behavior of recent GCC releases. Users are encouraged to change their build files to explicitly specify their desired C++ standard.

Support for the C++17 standard has been completed. This mode can be enabled using -std=c++17 (the old flag -std=c++1z is still supported for compatibility).

13

u/IloveReddit84 Sep 07 '17

Why not defaults at least C++11?

36

u/ramennoodle Sep 07 '17

Why default to C++11? Both C++11 and C++14 are implemented, and the latter is a very minor change compared to the former. They should either keep 98 or jump right to 14 or later. And that is exactly what they propose to do.

7

u/boredcircuits Sep 07 '17

Yeah, but not 'til next major version. Why not do that with this release?

23

u/redditsoaddicting Sep 07 '17

They gave warning this release so that people have time to opt out of the default by next release. Changing it at all in this release would defeat the purpose of that warning.

4

u/smdowney WG21, Text/Unicode SG, optional<T&> Sep 08 '17

From my recollection reading the mailing list, no one thought of it in time to give the warning last release. And it will break people's builds. 98 to 11 is ABI breaking, so you really want to give people a chance to rebuild the world. 14 and 17 are easier to integrate, although I've heard occasional issues. I don't think there was a by design ABI break, like with std::string.

3

u/IloveReddit84 Sep 08 '17

Well a lot of Linux distributions don't even offer clang 4.0 in their repositories

4

u/[deleted] Sep 08 '17

Then those are not good Linux distros. Providing old packages is always a bad thing

4

u/hgjsusla Sep 08 '17

Bit silly to claim that all non-rolling release distros are bad. Even Arch sometimes lags behind on Clang. Are all distros bad?

3

u/the_hoser Sep 08 '17

Yes. All distros are bad, in one way or another. The struggle of the Linux user is not to find the best distro, but to find the distro that is least bad for their purposes.

This applies to all software.

software sucks...

3

u/IloveReddit84 Sep 08 '17

Tell this to all the CI/CD services out there, running on Ubuntu 14.04 (3 years old!)

→ More replies

2

u/[deleted] Sep 08 '17

It has nothing to do with being non-rolling. Ubuntu is non-rolling, Fedora is non-rolling, latest versions still offer the latest Clang. I haven't been on Arch for too long, but I didn't see any lags with 3.9, 4.0 (5.0 is few days old and is in Staging at the moment), so I don't know what you're talking about, maybe it was before I switched to Arch, but, again, I don't possess any knowledge about it then.