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

[namespace.memdef]/3 #1395

Closed
wants to merge 8 commits into from
Closed

Conversation

jabelloc
Copy link

@jabelloc jabelloc commented Jan 21, 2017

The word first is confusing and unnecessary in [namespace.memdef]/3. It gives the impression that if the name in the friend declaration is not the first in its TU, the friend will not need to be a member of the innermost enclosing namespace, which is clearly incorrect as the snippet below shows:

void f(); namespace A { struct S { friend void f(); }; }

The name f is not first declared in the friend declaration. Nevertheless, the snippet will compile if the function f is declared in namespace A, either before or after the friend declaration.

@jensmaurer
Copy link
Member

This is core issue 138 "Friend declaration name lookup". As such, and given the repeated discussions around it, this does not seem to be editorial at all.

@jensmaurer jensmaurer added the cwg Issue must be reviewed by CWG. label Jan 21, 2017
@jensmaurer jensmaurer closed this Jan 21, 2017
@jabelloc jabelloc deleted the namespace.memdef/3 branch January 22, 2017 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants