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

[temp.names] Do not use "template-name" for "name referring to template" #3882

Conversation

hubert-reinterpretcast
Copy link
Contributor

From core/2020/03/8668.

The structure of [temp.names]/2 – 3 now (following P0846R0, "ADL and Function Templates that are not Visible"):

  • Uses template-name basically to handle only the class template cases, and
  • introduces the notion that names can be considered to refer to templates.

However, paragraph 3 is prefaced by "[when] a name is considered to be a template-name [emphasis mine]", which differs from "when a name is considered to refer to a template". In particular, it is a stretch to take a name not having the syntactic form of a template-name (such as an operator-function-id) as being considered to be a template-name merely because the name is considered to refer to a template.

@zygoloid
Copy link
Member

zygoloid commented Mar 17, 2020

The wording in this area for template names that are not template-names is ambiguous and there is implementation variance; see core/2019/05/6251 and replies. Note also that the previous paragraph talks only about the template-name case and not the other forms of template names. I don't think it's clear whether the committee intended for P0846R0 to apply to operator-function-ids and literal-operator-ids (or even considered the question).

@zygoloid zygoloid force-pushed the c++20 branch 3 times, most recently from e22901e to d4a00d6 Compare March 24, 2020 19:00
@zygoloid zygoloid changed the base branch from c++20 to master March 24, 2020 23:43
@jensmaurer jensmaurer added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Apr 13, 2020
@jensmaurer
Copy link
Member

This has a stray commit adding the foreword. Please rebase + force-push.

From core/2020/03/8668.

The structure of [temp.names]/2 – 3 now (following P0846R0, "ADL and
Function Templates that are not Visible"):

- Uses _template-name_ basically to handle only the class template
  cases, and
- introduces the notion that names can be considered to refer to
  templates.

However, paragraph 3 is prefaced by "[when] a name is **considered
to be a _template-name_** [emphasis mine]", which differs from "when a
name is **considered to refer to a template**". In particular, it is a
stretch to take a name not having the syntactic form of a
_template-name_ (such as an _operator-function-id_) as being considered
to be a _template-name_ merely because the name is considered to refer
to a template.
@hubert-reinterpretcast
Copy link
Contributor Author

This has a stray commit adding the foreword. Please rebase + force-push.

Done.

@jensmaurer jensmaurer removed the needs rebase The pull request needs a git rebase to resolve merge conflicts. label May 15, 2020
@zygoloid
Copy link
Member

We addressed this in a different way in 84087b3. We now define whether an identifier is grammatically a template-name, rather than whether "a name is considered to refer to a template", so this wording has become meaningful.

@zygoloid zygoloid closed this Oct 17, 2020
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 this pull request may close these issues.

None yet

3 participants