Project:C++/Supported -std= arguments

From Gentoo Wiki
Jump to: navigation, search

Clang and GCC have different support for the various ISO C and C++ standards. This page summarises the supported flags. Important: the tables on this page show which versions of GCC and Clang accept which -std= arguments. Just because some version of GCC implements -std=c++XY does not imply that it properly supports all features of C++XY. For instance, GCC 5 may support the -std=c++17 flag, but its support for C++17 is marginal at best. Furthermore, if a variant supports -std=c++XY, it will always support -std=gnu++XY too (which just enables a bunch of non-portable GNU extensions).

GCC

C

Version c1x c11 c17
GCC 4.2 - - -
GCC 4.3 - - -
GCC 4.4 - - -
GCC 4.5 - - -
GCC 4.6 + - -
GCC 4.7 + + -
GCC 4.8 + + -
GCC 4.9 + + -
GCC 5 + + -
GCC 6 + + -
GCC 7 + + -
GCC 8 + + +

C++

Version c++0x c++11 c++1y c++14 c++1z c++17 c++2a
GCC 4.2 - - - - - - -
GCC 4.3 + - - - - - -
GCC 4.4 + - - - - - -
GCC 4.5 + - - - - - -
GCC 4.6 + - - - - - -
GCC 4.7 + + - - - - -
GCC 4.8 + + + - - - -
GCC 4.9 + + + + - - -
GCC 5 + + + + + + -
GCC 6 + + + + + + -
GCC 7 + + + + + + -
GCC 8 + + + + + + +

Clang

C

Version c1x c11 c17
Clang 2.7 - - -
Clang 2.8 - - -
Clang 2.9 - - -
Clang 3.0 + - -
Clang 3.1 + + -
Clang 3.2 + + -
Clang 3.3 + + -
Clang 3.4 + + -
Clang 3.5 + + -
Clang 3.6 + + -
Clang 3.7 + + -
Clang 3.8 + + -
Clang 3.9 + + -
Clang 4.0 + + -
Clang 5.0 + + -
Clang 6.0 + + +

C++

Version c++0x c++11 c++1y c++14 c++1z c++17 c++2a
Clang 2.7 + - - - - - -
Clang 2.8 + - - - - - -
Clang 2.9 + - - - - - -
Clang 3.0 + + - - - - -
Clang 3.1 + + - - - - -
Clang 3.2 + + + - - - -
Clang 3.3 + + + - - - -
Clang 3.4 + + + - - - -
Clang 3.5 + + + + + - -
Clang 3.6 + + + + + - -
Clang 3.7 + + + + + - -
Clang 3.8 + + + + + - -
Clang 3.9 + + + + + - -
Clang 4.0 + + + + + - -
Clang 5.0 + + + + + + +
Clang 6.0 + + + + + + +