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

后端 未结 4 970
孤独总比滥情好
孤独总比滥情好 2021-01-31 15:44

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 feature

相关标签:
4条回答
  • 2021-01-31 16:20

    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.

    0 讨论(0)
  • 2021-01-31 16:26

    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.

    0 讨论(0)
  • 2021-01-31 16:31

    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.

    0 讨论(0)
  • 2021-01-31 16:45

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

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

    0 讨论(0)
提交回复
热议问题