37

Clang has a nice page describing the project status w.r.t. C++1z/C++17 feature support (and C++11 and C++14, it's the same page).

g++ has a page regarding C++14 features, but I couldn't find anything about C++17/C++1z. Is that being worked on but just not present on the web? For version 5.0?

q-l-p
  • 4,304
  • 3
  • 16
  • 36
einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • 1
    C++17 is in early development state and,m as I know, there's not support for it's features in GCC yet. Even clang has limited and experimental support for it (http://clang.llvm.org/cxx_status.html#cxx17). On the other hand some progress is being done in GCC too, see: https://patchwork.ozlabs.org/patch/370773/ or https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html. – Goofy Jul 05 '15 at 12:28
  • 3
    [libstdc++ 201z](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.201z) – Stephan Dollberg Jul 05 '15 at 12:41

4 Answers4

32

As of today, gcc's C++1z language support is tracked on: https://gcc.gnu.org/projects/cxx1z.html. For the C++1z status of libstdc++, see https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.201z.

Jan van Dijk
  • 421
  • 1
  • 3
  • 5
12

Updated final nutshell answer:

  • GCC 8.x (and later) fully supports all of C++17.
  • GCC 7.x supports all of C++17 except for class template argument deduction.
  • GCC 6.x (and earlier) has little or no support for C++17 features.

Thanks @JanVanDijk for the link to the full feature table.

einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • Support in [gcc](https://gcc.gnu.org/projects/cxx-status.html#cxx1z) is still listed as _experimental_. This is also implied by the [manual](https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Standards.html#C_002b_002b-Language). gcc 9 includes [_improved experimental support_](https://gcc.gnu.org/gcc-9/changes.html#cxx) for c++17 – wreckgar23 Apr 05 '19 at 10:17
  • The manual you linked to says "GCC supports all the changes in the new specification." The word "experimental" is not found on that page. – einpoklum Apr 05 '19 at 10:31
  • that's true, but then the link to follow for further information says that the support is _experimental_. Also, the first line of the manual only says _GCC supports the original ISO C++ standard published in 1998, and the 2011 and 2014 revisions_ – wreckgar23 Apr 05 '19 at 11:38
7

There is some support already; The following two summaries are oriented on Clang's list:

Supported (as of July 5th, 2015):

  • auto for function parameters is supported since 4.9. This feature is currently considered an extension but is included in the concepts proposal and called "generic functions".
  • trigraphs are being ignored by default since 5.1.0
  • typename for template template parameters since 5.1.0
  • new deduction rules for direct-list-initialization since 5.1.0
  • static_assert without a message in HEAD
  • u8 character literals in HEAD
  • Attributes for namespaces or enumerators in HEAD

Unsupported (as of July 5th, 2015; with links to a valid example usage):

For the status of implementation of library proposals in libstdc++, the corresponding manual has a list.

Columbo
  • 60,038
  • 8
  • 155
  • 203
  • "auto for function parameters" What is this? I cannot find this in the [C++17](https://en.wikipedia.org/wiki/C%2B%2B17) list. – Suma Jul 05 '15 at 13:59
  • Trigraphs aren't really a problem. If you want them, you can always define them to be part of the system's source encoding. – Kerrek SB Jul 05 '15 at 19:18
  • 1
    @Suma: "auto for function parameters" is C++14: https://stackoverflow.com/questions/17233547/how-does-generic-lambda-work-in-c14 (while the shown example is probably a gcc extension). – Thomas Jul 05 '15 at 20:06
  • @Thomas Nope. It's part of a planned feature for C++17; "Generic functions", part of the concepts paper. Generic lambdas are indeed C++14. – Columbo Jul 05 '15 at 21:27
  • 2
    @Columbo: As of 4.9 this must be an extension. See http://stackoverflow.com/a/25879737. You are compiling in C++14 mode, GCC 4.9 doesn't even recognize `-std=c++1z`. – Thomas Jul 06 '15 at 06:02
4

There is also a nice table at cppreference.com that lists supported features for several compilers.

http://en.cppreference.com/w/cpp/compiler_support

BoshWash
  • 5,320
  • 4
  • 30
  • 50
  • This actually appears to be more up-to-date and comprehensive than the feature pages maintained by the actual compiler vendors (!!!). – Kyle Strand May 01 '17 at 19:00
  • Actually, the MSVC page is pretty good, it's just hard to find: https://learn.microsoft.com/en-us/cpp/visual-cpp-language-conformance – Kyle Strand May 01 '17 at 19:03