Content-Length: 263014 | pFad | https://github.com/cplusplus/papers/issues/1273

B3 CWG2597 Replaceable allocation and deallocation functions in the global module · Issue #1273 · cplusplus/papers · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jensmaurer opened this issue Jun 25, 2022 · 5 comments · Fixed by cplusplus/draft#5664
Labels
CWG Core plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. straw-poll Straw poll

Comments

@jensmaurer
Copy link
Member

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.

@jensmaurer jensmaurer added the EWG Evolution label Jun 25, 2022
@ChuanqiXu9
Copy link

Should we change the suggested wording into the following?

and should be attached to the global module, otherwise the program is ill-formed.

Otherwise, I might recognize the example is well-formed personally.

module M;
void * operator new(std::size_t);

@jensmaurer
Copy link
Member Author

Note that this github paper tracker is for administration only, not for technical discussion.

(In your example, your declaration of "operator new" is attached to M, which conflicts with the attachment of the predeclared "operator new". And that's ill-formed.)

@erichkeane
Copy link
Collaborator

erichkeane commented Jul 7, 2022

This was discussed during the July 7th, 2022 EWG Telecon. The following Poll was taken:

EWG agrees with the resolution of CWG2597 as proposed.

SF F N A SA
4 6 0 0 0

Result: Consensus

Consensus was strong, and discussion didn't result in any one having concerns, so forwarding without Electronic Polling was ruled acceptable.

@erichkeane erichkeane added CWG Core and removed EWG Evolution labels Jul 7, 2022
@jensmaurer jensmaurer added the straw-poll Straw poll label Jul 15, 2022
@jensmaurer
Copy link
Member Author

CWG telecon 2022-07-15: Approved.

@cor3ntin cor3ntin added the plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. label Jul 25, 2022
@tkoeppe
Copy link

tkoeppe commented Aug 19, 2022

This has been applied.

@tkoeppe tkoeppe closed this as completed Aug 19, 2022
@jensmaurer jensmaurer added this to CWG Jul 15, 2024
@jensmaurer jensmaurer moved this to Approved for plenary vote in CWG Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CWG Core plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. straw-poll Straw poll
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/cplusplus/papers/issues/1273

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy