Title
Typedefs, names, and entities
Status
nad
Section
6.1 [basic.pre]
Submitter
Alisdair Meredith

Created on 2019-07-29.00:00:00 last changed 65 months ago

Messages

Date: 2022-02-18.07:47:23

According to 6.1 [basic.pre] paragraph 4,

A name is a use of an identifier (5.11 [lex.name]), operator-function-id (12.4 [over.oper]), literal-operator-id (12.6 [over.literal]), conversion-function-id (11.4.8.3 [class.conv.fct]), or template-id (13.3 [temp.names]) that denotes an entity or label (8.7.6 [stmt.goto], 8.2 [stmt.label]).

Since typedefs are neither entities nor labels, it appears that a typedef-name is not a name.

There is an additional discrepancy regarding alias templates. According to 6.1 [basic.pre] paragraph 3, templates (including, presumably, alias templates) and their specializations are entities. However, the note in 13.3 [temp.names] paragraph 6 says,

[Note: A simple-template-id that names a class template specialization is a class-name (11.3 [class.name]). Any other simple-template-id that names a type is a typedef-name. —end note]

Thus an alias template specialization both is and is not an entity.

History
Date User Action Args
2019-07-29 00:00:00admincreate