Title
Missing/incorrect feature test macro for coroutines
Status
c++20
Section
[version.syn]
Submitter
Barry Revzin

Created on 2020-01-25.00:00:00 last changed 38 months ago

Messages

Date: 2020-02-12.03:28:55

Proposed resolution:

This wording is relative to N4849.

  1. Modify [cpp.predefined], Table [tab:cpp.predefined.ft], as indicated:

    Table 18: Feature-test macros [tab:cpp.predefined.ft]
    Macro name Value
    […]
    __cpp_impl_coroutines 201902L
    […]
  2. Modify [version.syn], header <version> synopsis, as indicated:

    […]
    #define __cpp_lib_constexpr_vector    201907L // also in <vector>
    #define __cpp_lib_coroutine           201902L // also in <coroutine>
    #define __cpp_lib_destroying_delete   201806L // also in <new>
    […]
    
Date: 2020-02-12.03:28:55

[ 2020-02 Moved to Immediate on Tuesday in Prague. ]

Date: 2020-02-15.00:00:00

[ 2020-02-11, Prague ]

LWG observed that the naming suggestion didn't follow naming conventions of SG-10 because of the plural form corountines. The submitter agreed with that complaint, so the revised wording uses now the singular form.

Date: 2020-02-11.12:33:15

We have a policy, established in P1353 (and needing to be added to SD-6):

In some cases a feature requires two macros, one for the language and one for the library. For example, the library does not want to define its three-way comparison operations unless the compiler supports the feature.

For end-users, it is suggested that they test only the library macro, as that will only be true if the language macro is also true. As a result, the language macros contain "impl" to distinguish them from the more general version that is expected to be set by the library. That paper added two papers of macros: one for <=> and one for destroying delete. We have a third such example in coroutines: there is library machinery that needs to be provided only when the compiler has language support for it, and the end user should just check the library macro.

Previous resolution [SUPERSEDED]:

This wording is relative to N4849.

  1. Modify [cpp.predefined], Table [tab:cpp.predefined.ft], as indicated:

    Table 18: Feature-test macros [tab:cpp.predefined.ft]
    Macro name Value
    […]
    __cpp_impl_coroutines 201902L
    […]
  2. Modify [version.syn], header <version> synopsis, as indicated:

    […]
    #define __cpp_lib_constexpr_vector    201907L // also in <vector>
    #define __cpp_lib_coroutines          201902L // also in <coroutine>
    #define __cpp_lib_destroying_delete   201806L // also in <new>
    […]
    
History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-12 03:28:55adminsetmessages: + msg11044
2020-02-12 03:28:55adminsetstatus: new -> immediate
2020-02-11 12:33:15adminsetmessages: + msg11038
2020-02-09 19:45:23adminsetmessages: + msg11004
2020-01-25 00:00:00admincreate