Skip to content

CWG2597 Replaceable allocation and deallocation functions in the global module #1273

@jensmaurer

Description

@jensmaurer

Subclause 10.1 [module.unit paragraph 7] implicitly attaches the replaceable global allocation or deallocation functions to the global module. Now that extern "C++" can be used to introduce declarations in the global module, even when in the purview of a named module, the provision seems superfluous.

https://cplusplus.github.io/CWG/issues/2597.html

Example:

module M;
void * operator new(std::size_t);  // before: well-formed; after: ill-formed because attachment conflict with the predeclared version
extern "C++" void * operator new(std::size_t);   // well-formed before and after

This is a user-visible design change, imposing a small ergonomic cost for a rare case in exchange for the removal of a special case, and thus should have EWG approval.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CWGCoreplenary-approvedPapers approved for inclusion in their target vehicle by plenary vote.straw-pollStraw poll

    Type

    No type

    Projects

    Status

    Approved for plenary vote

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions