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

拜拜、爱过 提交于 2019-12-03 04:46:17

问题


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?


回答1:


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.




回答2:


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):

  • Fold expressions
  • Nested namespace definitions
  • Constant evaluation for all non-type template arguments

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




回答3:


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.




回答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



来源:https://stackoverflow.com/questions/31230201/whats-the-status-of-c17-support-in-gcc

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