Title
Imprecise wording regarding dependent types
Status
cd5
Section
13.8 [temp.res]
Submitter
Daveed Vandevoorde

Created on 2011-03-24.00:00:00 last changed 48 months ago

Messages

Date: 2017-11-15.00:00:00

Notes from the November, 2017 meeting:

This topic is addressed in paper P0634.

Date: 2016-11-15.00:00:00

Notes from the November, 2016 meeting:

The resolution for this issue should describe the type to which a typename-specifier refers, effectively the type named by the corresponding simple-type-specifier with typename removed.

Date: 2018-03-15.00:00:00

[Accepted as a DR at the March, 2018 (Jacksonville) meeting as part of paper P0634R3.]

According to 13.8 [temp.res] paragraph 3,

When a qualified-id is intended to refer to a type that is not a member of the current instantiation (13.8.3.2 [temp.dep.type]) and its nested-name-specifier refers to a dependent type, it shall be prefixed by the keyword typename, forming a typename-specifier. If the qualified-id in a typename-specifier does not denote a type, the program is ill- formed.

The intent of the programmer cannot form the basis for a compiler determining whether to issue a diagnostic or not.

Suggested resolution:

Let N be a qualified-id with a nested-name-specifier that denotes a dependent type. If N is not prefixed by the keyword typename, N shall refer to a member of the current instantiation or it shall not refer to a type.

    typename-specifier:
      typename nested-name-specifier identifier
      typename nested-name-specifier templateopt simple-template-id

If the qualified-id in a typename-specifier does not denote a type, the program is ill-formed.

(See also issues 590 and 591.)

History
Date User Action Args
2020-12-15 00:00:00adminsetstatus: dr -> cd5
2018-04-11 00:00:00adminsetstatus: drafting -> dr
2018-02-27 00:00:00adminsetmessages: + msg5914
2017-02-06 00:00:00adminsetmessages: + msg5759
2011-03-24 00:00:00admincreate