[llvm-dev] Using C++14 code in LLVM

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 2 13:48:46 PDT 2016


On 2 October 2016 at 18:07, Pete Cooper via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I haven't been following C++14 closely, but from hallway conversations at work it seems like 17 is the bigger win in terms of features.
>
> Is it worth waiting for 17 instead? Or, as we will only get a subset of 14 features anyway, just instead take a subset of 17 features?

I believe C++14 has enough C++11 bug fixes to be worth moving to.


> Finally, I think we have clang 3.1 as the min version. Anyone know what that minimum will move to for the 14 support needed? I don't think it's as much of an issue as most distros are gcc based, but still good to know.

We'd have to bump it, but as Zach said, Clang 3.4 has all the
features, so that should be fine.

According to DistroWatch, these are the distros that have 4.9 or higher:

Mint 18 [2016-06]
Ubuntu Utopic [2014-10] (14.10, current 16.04 LTS)
Debian Jessie [2015-04] (8.0 stable, current)
Fedora 21 [2014-12] (current stable: 24)
Slackware 14.2 [2016-07]

And these are the ones that dont:

RedHat (latest is 4.8.5)
OpenSUSE (latest stable is 4.8)
SLES (latest stable is 4.8.5)
CentOS (latest stable is 4.8.5)

So, it's pretty clear that, even if the compiler is 2 or 4 years old,
the distributions are only picking up now and commercially-focused
distributions haven't got there yet.

Based on those numbers, I'd say 4.8 is a good minimum for now. The
BSDs seem to be in a similar conundrum, so it would be pretty bad to
move the requirement to 4.9 and forcing large swaths of people to
manually download / compile their toolchains.

Clang may work natively, but it definitely doesn't work cross-compiled
our of the box, and sometimes not at all. It also needs binutils and
glibc support, which we're not even considering here.

On Linux, GNU compatibility is important, and even if we had a full
toolchain (using rt, libc++, lld, musl/newlib, etc), we'd still need
to be compatible with GNU objects, shared libraries, etc.

I like using new C++14 features just as much as the next guy, but I
prefer to have a stable and usable environment more.

cheers,
--renato


More information about the llvm-dev mailing list