Skip to content

CWG2588 friend declarations and module linkage #1253

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

Closed
jensmaurer opened this issue May 26, 2022 · 3 comments · Fixed by cplusplus/draft#7099
Closed

CWG2588 friend declarations and module linkage #1253

jensmaurer opened this issue May 26, 2022 · 3 comments · Fixed by cplusplus/draft#7099
Labels
CWG Core plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.

Comments

@jensmaurer
Copy link
Member

The linkage of friend functions and classes is unclear, if the first (and possibly only) declaration is in a class.

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

@jensmaurer jensmaurer added the EWG Evolution label May 26, 2022
@jensmaurer jensmaurer added this to the 2022-telecon milestone May 26, 2022
@erichkeane
Copy link
Collaborator

EWG Discussed this during the June 9th, 2022 EWG telecon, and the following polls were taken:

A friend's linkage should be affected by the linkage of the befriending class (#1).

SF F N A SA
0 1 0 4 0

Result: Not Consensus

A friend's linkage should be affected by the presence/absence of export on the containing class definition itself (#2).

SF F N A SA
0 1 4 0 0

Result: Not Consensus

A friend's linkage should be affected by the presence/absence of export on the containing class definition itself, but ONLY if the friend is a definition (#2, modified by Jason's suggestion).

SF F N A SA
3 3 0 0 1

Result: Consensus

A friend's linkage should be determined per 11.8.4p4 alone (#3).

SF F N A SA
0 0 1 4 0

Result: Not Consensus

A friend's linkage should be as-if the declaration inhabited the nearest enclosing namespace scope (#4).

SF F N A SA
0 0 4 0 1

Result: Not Consensus

Confirmation of the 3rd poll is required to go through EWG Electronic polling.

@erichkeane erichkeane added the EWG-vote-on-me EWG can vote on this label Jun 9, 2022
@jfbastien
Copy link
Collaborator

This was voted on in the June 2022 EWG polls. Results are here.

🗳 Poll: A friend’s linkage should be affected by the presence/absence of export on the containing class definition itself, but ONLY if the friend is a definition (option #2, modified by Jason’s suggestion). This resolves CWG2588.

Note: Jason’s suggestion: A friend declaration shouldn’t affect linkage if it is not a definition. Exporting definition of class exports "friendliness" but not export of friend function itself.


SF F N A SA
4 12 4 1 1
Abstain: 6


Poll outcome: ✅ consensus

@jfbastien jfbastien added CWG Core and removed EWG-vote-on-me EWG can vote on this EWG Evolution labels Jul 10, 2022
@jensmaurer jensmaurer added the needs-revision Paper needs changes before it can proceed label Jul 10, 2022
@jensmaurer jensmaurer modified the milestones: 2022-telecon, 2023-02 Jan 25, 2023
@jensmaurer jensmaurer removed this from the 2023-02 milestone Mar 31, 2023
@jensmaurer jensmaurer added this to CWG Jul 15, 2024
@jensmaurer jensmaurer moved this to Awaiting updated wording in CWG Jul 15, 2024
@jensmaurer jensmaurer removed the needs-revision Paper needs changes before it can proceed label Jul 17, 2024
@jensmaurer jensmaurer moved this from Awaiting updated wording to Approved for plenary vote in CWG Jul 17, 2024
@jensmaurer
Copy link
Member Author

Moved in St. Louis.

@jensmaurer jensmaurer added the plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. label Jul 17, 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.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants