What's the status of C++17 support in GCC?

心已入冬 提交于 2019-12-02 17:57:00

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.

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.

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) little or no support for C++17 features.

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

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

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!