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

I find the first comment in the example in [basic.lookup.elab]/3 inaccurate #2802

Closed
Ayrosa opened this issue Mar 20, 2019 · 4 comments · Fixed by #2822
Closed

I find the first comment in the example in [basic.lookup.elab]/3 inaccurate #2802

Ayrosa opened this issue Mar 20, 2019 · 4 comments · Fixed by #2822
Assignees

Comments

@Ayrosa
Copy link

Ayrosa commented Mar 20, 2019

The example in [basic.lookup.elab]/3 starts with the following:

struct Node {
    struct Node* Next; // OK: Refers to Node at global scope
    struct Data* Data; // OK: Declares type Data at global scope and member Data
};

The first comment above should be replaced by "Refers to the injected class name Node" according to the previous paragraph which says:

If the elaborated-type-specifier has no nested-name-specifier, and unless the elaborated-type-specifier appears in a declaration with the following form:

    class-key attribute-specifier-seqopt identifier ;

the identifier is looked up according to [basic.lookup.unqual] but ignoring any non-type names that have been declared.

Finally, [basic.lookup.unqual/7 confirms that the lookup for the name Node started in struct Node * Next; finds the injected class name Node, not the Node in global scope.

@jwakely
Copy link
Member

jwakely commented Mar 20, 2019

Aside: should the example in [basic.lookup.elab] p3 be a new paragraph? It seems to be showing the rules of the entire sub-clause, not just those in paragraph 3 that it's attached to.

@Ayrosa
Copy link
Author

Ayrosa commented Mar 21, 2019

I wouldn't go that far. All the lookups in the example start with class names in elaborated-type-specifiers .

@jwakely
Copy link
Member

jwakely commented Mar 21, 2019

The paragraph talks about "If the elaborated-type-specifier has a nested-name-specifier," and that doesn't apply to everything in the example.

@Ayrosa
Copy link
Author

Ayrosa commented Mar 21, 2019

Yes, you're right. In that case it makes some sense to move the example to a new paragraph, although I don't feel uncomfortable with the way it's laid out now.

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

Successfully merging a pull request may close this issue.

3 participants