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

[module.context] Instantiation context is inconsistently defined #3985

Open
sdkrystian opened this issue May 6, 2020 · 2 comments
Open

[module.context] Instantiation context is inconsistently defined #3985

sdkrystian opened this issue May 6, 2020 · 2 comments
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.

Comments

@sdkrystian
Copy link
Contributor

sdkrystian commented May 6, 2020

The definition of instantiation context is as follows:

The instantiation context is a set of points within the program that determines which names are visible to argument-dependent name lookup and which declarations are reachable in the context of a particular declaration or template instantiation.

(side note: I'm pretty sure "template instantiation" should be "specialization" here)

We further go on to state:

In any other case, the instantiation context at a point within the program comprises that point.

The last bullet here seems to be inconsistent with the rest of the definition; we defined instantiation context to be relative to a declaration (or specialization), but then we specify what it is in the context of a program point.

Also, instead of "during the instantiation of [...]" we should say "in the context of [...]" as the lookup would be performed within the specialization/implicit definition.

@jensmaurer
Copy link
Member

I think we intentionally refer to "template instantiation" (i.e. the act of producing a specialization), because that's a situation where name lookup happens (again). Once you have an instantiated specialization, name lookup is a thing of the past.

For the second issue, I'm not seeing it either. We say an instantiation context is a set of points, and we specify in an "otherwise" a set with a single element.

@sdkrystian
Copy link
Contributor Author

@jensmaurer For the second issue, the problem there is not what we define instantiation context as, but the context for which we define it (i.e. for a point in the program, the instantiation context is [...])

Reachability (in [module.reach]) is defined as:

A declaration D is reachable if, for any point P in the instantiation context [...]

This doesn't provide a context (i.e. the program point) from which we are "getting" the instantiation context.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.
Projects
None yet
Development

No branches or pull requests

2 participants