This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

3784. std.compat should not provide ::byte and its friends

Section: 16.4.2.4 [std.modules] Status: WP Submitter: Jiang An Opened: 2022-09-19 Last modified: 2022-11-17

Priority: Not Prioritized

View all issues with WP status.

Discussion:

Currently 16.4.2.4 [std.modules]/3 seemly requires that the std.compat module has to provide byte (via <cstddef>), beta (via <cmath>) etc. in the global namespace, which is defective to me as these components are C++-only, and doing so would increase the risk of conflict.

I think we should only let std.compat provide the same set of global declarations as <xxx.h> headers.

[2022-10-12; Reflector poll]

Set status to Tentatively Ready after nine votes in favour during reflector poll.

[2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4917.

  1. Modify 16.4.2.4 [std.modules] as indicated:

    -3- The named module std.compat exports the same declarations as the named module std, and additionally exports declarations in the global namespace corresponding to the declarations in namespace std that are provided by the C++ headers for C library facilities (Table 26), except the explicitly excluded declarations described in 17.14.7 [support.c.headers.other].