It’s been almost a year since my last comparison of C++11 support across different compilers, so I decided to take a break from working on my book about C++11/14 features in VS2013, and see how things have changed.

Once again, I’d like to see how different compilers stack up based on the documentation for the pre-release versions of these compilers. I’ve also included some of the current released versions for comparison.

Of course, now we have C++14 to think about in addition to C++11, so I’ve included C++14 in this comparison too.

The pre-release versions of the compilers are as follows: GCC 4.9, Clang 3.4 and Visual Studio Nov 2013 CTP.

First, let’s look at the C++11 language features. Clang 3.3 and above, and GCC 4.8 and later have complete support, so there was no point including them in the table.

C++11 language features support

FeatureVS Nov 2013 CTPVS2013Intel 14.0
autoYesYesYes
decltypeYesYesYes
Lambda expressionsYesYesYes
nullptrYesYesYes
static_assertYesYesYes
Range based for loopYesYesYes
Trailing return type in functionsYesYesYes
extern templatesYesYesYes
>> for nested templatesYesYesYes
Local and unnamed types as template argumentsYesYesYes
Variadic macrosYesYesYes
Variadic templatesYesYesYes
Default template arguments in function templatesYesYesYes
final method keywordYesYesYes
override method keywordYesYesYes
Strongly typed enumsYesYesYes
Forward declared enumsYesYesYes
Explicit type conversion operatorsYesYesYes
Raw string literalsYesYesYes
Delegating constructorsYesYesYes
Template aliasesYesYesYes
Non-static data member initializersYesYesYes
Deleted methodsYesYesYes
Initializer listsYesPartialYes
Rvalue references and move semanticsYesPartialYes
Defaulted methodsYesPartialYes
C99 compatibilityPartialPartialYes
New built-in typesPartialPartialPartial
Member function ref qualifiersYesNoYes
noexceptPartialNoYes
constexprPartialNoYes
Alignment supportYesPartialNo
Magic staticsYesNoPartial
Thread local storagePartialPartialNo
Generalized attributesNoNoYes
Inline namespacesNoNoYes
sizeof on non-static data members without an instanceYesNoNo
Encoding support in literalsNoNoYes
Arbitrary expressions in template deduction contextsNoNoYes
Inheriting constructorsYesNoNo
Changed restrictions on union membersNoNoPartial
User defined literalsNoNoNo

It looks like the Intel compiler is on par with the Visual Studio CTP. But Intel’s 14.0 compiler has been out for some time, while VS CTP is an alpha quality compiler, which means that Visual Studio trails behind everybody else, unfortunately.

How about C++14 support? The C++ standard is still in draft, but some compilers already have extensive support for C++14 language features:

C++14 language features support

FeatureClang 3.4GCC 4.9VS Nov 2013 CTPIntel 14.0
Return type deduction for regular functionsYesYesYesNo
Binary literalsYesYesNoYes
Generic lambdasYesYesPartialNo
Tweaked wording for contextual conversionsYesYesNoNo
Runtime sized arrays with automatic storage durationYesYesNoNo
Initialized lambda capturesYesYesNoNo
[[deprecated]] attributeYesYesNoNo
Single quotation mark as digit separatorYesYesNoNo
C++ sized deallocationYesYesNoNo
Variable templatesYesNoNoNo
Relaxed requirements on constexpr functionsYesNoNoNo
Member initializers and aggregatesYesNoNoNo
Avoiding/fusing memory allocationsYesN/ANoNo

As far as libraries go, libstdc++, libc++ and Microsoft’s libraries all have at least partial support for all the features introduced in C++11. So instead of detailing those, I’ll focus on C++14 features. Once again, this is for the latest pre-release versions of the libraries available today:

C++14 library features support

Featurelibc++libstdc++VS Nov 2013 CTP
make_uniqueYesYesYes
Improved operator functorsYesYesYes
Additional template aliases for transformation type traitsYesYesYes
Fixing constexpr member functions without constYesYesNo
exchange() utility functionYesYesNo
Retrieving tuple elements by typeYesYesNo
std::result_of and SFINAEYesYesNo
Improvements to integral_constantYesYesNo
User-defined literals for standard library types YesYesNo
More robust non-modifying sequence operationsYesYesNo
Quoted string I/O manipulatorYesYesNo
constexpr library additions: chronoYesYesNo
constexpr library additions: containersYesYesNo
constexpr library additions: utilitiesYesYesNo
constexpr library additions: complexYesNoNo
constexpr library additions: functionalYesNoNo
Compile-time integer sequencesYesYesNo
Shared lockingYesYesNo
Heterogeneous comparison lookup in associative containersYesNoNo
Null forward iteratorsYesNoNo
Sized deallocationNoNoNo
Consistent metafunction aliasesNoNoNo
Discouraging rand() in C++14NoNoNo

Conclusion

Clang is obviously leading on the C++14 conformance front. There are also quite a few features implemented in GCC as well.

The interesting thing is that the process of building compilers to conform to the latest C++ standard has accelerated in recent years. With C++14, Clang has complete language support even before the standard has been finalized.

But it would be really great if Microsoft and Intel picked up their game, and brought their compilers’ conformance to the level of Clang and GCC.