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

Injected-class-names: members or not? #3440

Closed
sdkrystian opened this issue Nov 13, 2019 · 1 comment
Closed

Injected-class-names: members or not? #3440

sdkrystian opened this issue Nov 13, 2019 · 1 comment

Comments

@sdkrystian
Copy link
Contributor

[class.pre] p2 says:

For purposes of access checking, the injected-class-name is treated as if it were a public member name.

[class.member.lookup] p3 says:

[...] type declarations (including injected-class-names) are replaced by the types they designate.

Here, it is incorrectly assumed that an injected-class-name is a member, which it is not. Specifying that an injected-class-name is a nested type would resolve this.

A better definition would be something along the lines of:

A nested type denoting the class-name is declared as a public member; this is known as the injected-class-name.

@jensmaurer
Copy link
Member

[basic.lookup] p3 says

The injected-class-name of a class (Clause 11) is also considered to be a member of that class for the purposes of name hiding and lookup.

So, member lookup is supposed to find it. I'm not seeing a problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants