This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2023-01-15


1271. Imprecise wording regarding dependent types

Section: 13.8  [temp.res]     Status: CD5     Submitter: Daveed Vandevoorde     Date: 2011-03-24

[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.

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

(See also issues 590 and 591.)

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.

Notes from the November, 2017 meeting:

This topic is addressed in paper P0634.