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

Matthieu Monrocq matthieu.monrocq at gmail.com
Sun Jan 13 11:10:02 PST 2013


On Sun, Jan 13, 2013 at 7:39 PM, David Blaikie <dblaikie at gmail.com> wrote:

> On Sun, Jan 13, 2013 at 10:26 AM, Tim Northover <t.p.northover at gmail.com>
> wrote:
> >> Good points David, I don't feel qualified to evaluate the differences
> >> between those versions though... Perhaps Richard or Doug could comment
> here?
> >
> > Unless I'm misreading the buildbots, we don't actually have anything
> > trying to build with MSVC. Have we considered how we're going to
> > enforce these rather subtle distinctions?
>
> The buildbots on lab.llvm.org don't cover Windows, but Takumi
> maintains Windows buildbots & fairly diligently (autoreporting to IRC,
> plus manual follow up on review threads, etc) maintains them. Some
> other developers (such as Michael Spencer) work on Windows on a
> regular basis, so they'll essentially come screaming if it breaks ;)
>


Following the feedback from David, here is an updated list of the profiles,
taking into account deprecated versions of the specifications of the
lambdas and r-values that might be of interest. As before, they are duly
annotated with a remark.

gcc 4.3, MSVC 10, clang 3.0
=> main benefits are decltype v1.0 [1], 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.1
=> main additions: lambda v1.0 [2], local types as template arguments,
r-value v2.0 [3].

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].

Note: the only benefit of gcc 4.6 + MSVC10 over gcc 4.5 + MSVC10 is
"nullptr".


As we can see, if we are confident enough in the Windows buildbots to pick
up the differences between the various versions (and I suppose we already
rely on them), then the version proposed by Chris does provide a number of
new C++11 features compared to the current state:

gcc 4.5, MSVC 10, clang 3.1
- decltype v1.0 [1] + late specified return type
- lambda v1.0 [2]
- local types as template arguments
- r-value 2.0 [3]
- static_assert
- built-in type traits

The only issue I can see is that a number of people emitted the idea that
gcc 4.5 might be too advanced for a number of platforms (including RedHat
for example).

-- Matthieu


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

[2]: "lambda v1.0 (n2658)" is subsided by "lambda v1.1 (n2927)", not sure
of the exact impact of the changes.

[3]: "r-value v2.0 (n2844)" and "r-value v2.1 (n2844 + core issue 1138)"
are subsided by "r-value v3.0 (n3053)" once again not sure of the impact of
the changes; furthermore it seems no released 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130113/10e1bb1b/attachment.html>


More information about the llvm-dev mailing list