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

Definition of "name lookup" is misleading #7472

Open
t3nsor opened this issue Dec 3, 2024 · 0 comments · May be fixed by #7475
Open

Definition of "name lookup" is misleading #7472

t3nsor opened this issue Dec 3, 2024 · 0 comments · May be fixed by #7475
Assignees
Milestone

Comments

@t3nsor
Copy link
Contributor

t3nsor commented Dec 3, 2024

The definition of "name lookup" is given in [basic.pre]/8:

Some names denote types or templates. In general, whenever a name is encountered it is necessary to determine whether that name denotes one of these entities before continuing to parse the program that contains it. The process that determines this is called name lookup ([basic.lookup]).

This is one purpose of name lookup, not the only one.

I suggest to convert this paragraph to a note and edit it as shown:

[Note: Some names denote types or templates. In general, whenever a name is encountered it is necessary to look it up ([basic.lookup]) to determine whether that name denotes one of these entities before continuing to parse the program that contains it. The process that determines this is called name lookup ([basic.lookup]). end note]

Then, in [basic.lookup.general], move the second sentence to the beginning and make it the definition.

Name lookup associates the use of a name with a set of declarations ([basic.def]) of that name. The name lookup rules apply uniformly to all names (including typedef-names ([dcl.typedef]), namespace-names ([basic.namespace]), and class-names ([class.name])) wherever the grammar allows such names in the context discussed by a particular rule. Name lookup associates the use of a name with a set of declarations ([basic.def]) of that name.

@jensmaurer jensmaurer self-assigned this Dec 6, 2024
@jensmaurer jensmaurer added this to the post-2024-11 milestone Dec 6, 2024
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.

2 participants