C++1y/C++14 Support in GCC

GCC is beginning to introduce support for the latest revision of the C++ standard, which was published in 2014.

C++14 features are available as part of the "mainline" GCC compiler in the trunk of GCC's Subversion repository and in GCC 4.8 and later. To enable C++14 support, add the command-line parameter -std=c++14 to your g++ command line. Or, to enable GNU extensions in addition to C++0x extensions, add -std=gnu++14 to your g++ command line.

Important: Because the final ISO C++14 standard was only recently published, GCC's support is experimental. No attempt will be made to maintain backward compatibility with implementations of C++14 features that do not reflect the final standard.

C++14 Language Features

The following table lists new language features that are part of the C++14 standard. The "Proposal" column provides a link to the ISO C++ committee proposal that describes the feature, while the "Available in GCC?" column indicates the first version of GCC that contains an implementation of this feature (if it has been implemented).

Language Feature Proposal Available in GCC?
Tweak to certain C++ contextual conversions N3323 4.9
Binary literals N3472 4.3 (GNU)
4.9 (N3472)
Return type deduction for normal functions N3638 4.8 (N3386)
4.9 (N3638)
Runtime-sized arrays with automatic storage duration
(Moved from the standard to a separate technical specification)
N3639 ?.? (GNU VLAs)
4.9 (N3639)
Generalized lambda capture (init-capture) N3648 4.5 (partial)
4.9 (N3648)
Generic (polymorphic) lambda expressions N3649 4.9
Variable templates N3651 5
Relaxing requirements on constexpr functions N3652 No
Member initializers and aggregates N3653 No
Clarifying memory allocation N3664 N/A
Sized deallocation N3778 No
[[deprecated]] attribute N3760 4.9 (N3797)
Single-quotation-mark as a digit separator N3781 4.9 (N3797)

C++14 Library Features

The status of the library implementation can be tracked in this table

Development Branches

C++1y Concepts Branch

Concepts was a major feature planned for the C++11 standard, but it was eventually dropped due to concerns about both the description and implementability. Since the publication of C++11, people have been working on scaled-down versions of the concepts feature. One approach to concepts, known as Concepts Lite, has been prototyped in GCC and seems likely to be published as a Technical Specification around the time of the next standard. The initial implementation is available from the link above, and it is in the process of being cleaned up and moved into the c++-concepts branch.