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

GCC has 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++14 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)
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 5
Member initializers and aggregates N3653 5
Clarifying memory allocation N3664 N/A
Sized deallocation N3778 5
[[deprecated]] attribute N3760 4.9 (N3797)
Single-quotation-mark as a digit separator N3781 4.9 (N3797)

This feature was briefly part of the C++14 working paper, but was not part of the published standard; as a result, it has been removed from the compiler.

Language Feature Proposal Available in GCC?
Runtime-sized arrays with automatic storage duration
(Removed from the standard)
N3639 ?.? (GNU VLAs)
4.9 (N3639)
5 (GNU VLAs)

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.