[LLVMdev] Using C++'11 language features in LLVM itself

Matthieu M. matthieu.monrocq at gmail.com
Sun Jan 13 05:18:11 PST 2013

Hello all,

Using the Apache Wiki [1] I summed up what can be used simultaneously by gcc,
MSVC and clang.

I mostly considered only the latest versions of the proposals where there were
several, where not there is a link to a note at the bottom. Furthermore I did
not scourge through 3 bug databases and I implicitly trusted the wiki page.

I drew up a list of profiles, listing the base capabilities for the first and
then what each of them adds to the previous one. The version of clang is the
minimum possible adjusted so as not to limited what the gcc/MSVC combination

gcc 4.3, MSVC 10, clang 3.0
=> main benefits: decltype v1.0 [2], static_assert and built-in type traits.

gcc 4.4, MSVC 10, clang 3.0
=> main additions: late specified return type.

gcc 4.5, MSVC 10, clang 3.0
=> only addition (sorry Chris): local types as template arguments.

gcc 4.5, MSVC 11, clang 3.1
=> main additions: atomic, lambda v1.1, r-value v2.1 [3], strongly typed enum.

gcc 4.6, MSVC 11, clang 3.1
=> main additions: forward enum, nullptr, range-based for.

gcc 4.7, MSVC 11, clang 3.1
=> main additions: override/final, template aliases.

gcc 4.7, MSVC 11 nov' 12, clang 3.1
=> main additions: initializer lists, variadic templates v1.0 [4].

Even though the later profiles may not be of immediate interest, I included them
for completeness and to maybe help shape up the C++11 inclusion road map.

I hope this might prove helpful in the upcoming decision. I would advise people
who want a closer look to check the Apache page summing up the compiler
capabilities by themselves.

-- Matthieu.

PS: thanks to Stephen Kelly for showing me how to use gmane to barge in.

[1]: http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport

[2]: "decltype v1.0 (n2343)" is subsided by "decltype v1.1 (n3276)" which drops
the completeness requirement of return types; unfortunately it seems no known
version of gcc implements v1.1.

[3]: "r-value v2.1 (n2844 + core issue 1138)" is subsided by "r-value v3.0
(n3053)" but I could not understand the gist of the differences; furthermore it
seems no known version of MSVC implements v3.0.

[4]: a prior implementation of variadic templates (dubbed v0.9) was available as
soon as gcc 4.4 (with issues regarding template template parameters matching),
however MSVC never implemented it and jumped straight to v1.0 in the CTP release.

More information about the llvm-dev mailing list