Date
2022-05-13.17:08:26
Message id
11480

Content

From this editorial issue request:

The header <stddef.h> is currently specified in [support.c.headers.other] to not declare a global name corresponding to std::byte, but no similar exclusion exists for std::nullptr_t.

Is an oversight or intentional? There does not seem to be an interoperability reason to provide a global namespace name ::nullptr_t, since this construction would be meaningless in C and thus the name would not be encountered in code that is both valid C and C++.

For lack of justification, I would like to propose to require normatively that no name ::nullptr_t be declared by <stddef.h>.

Additional notes: The proposing paper N2431 mentions only an addition of "nullptr_t" to <cstddef> and does not discuss the impact on <stddef.h>. By omission this means the default rules for <stddef.h> apply and the global name should exist, but this does not provide us with a positive signal of intention.

I also realize that this is a rather obscure point, and that vendors are already shipping ::nullptr_t, so I am also happy to drop this issue as not being worth the churn and the increase in implementation complexity (since removals don't generally simplify implementations). I would welcome a bit of discussion, though.