CWG Issue 62 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-04-13
62. Unnamed members of classes used as type parameters
Section: 13.4.2 [temp.arg.type]Status: CD1Submitter: Steve AdamczykDate: 13 Oct 1998
[Moved to DR at 4/01 meeting.]
Section 13.4.2 [temp.arg.type] paragraph 2 says
A local type, a type with no linkage, an unnamed type or a type compounded from any of these types shall not be used as a _template-argument_for a template type-parameter.
It probably wasn't intended that classes with unnamed members should be included in this list, but they are arguably compounded from unnamed types.
Proposed resolution (04/01):
In 13.4.2 [temp.arg.type] paragraph 2, change
A local type, a type with no linkage, an unnamed type or a type compounded from any of these types shall not be used as a_template-argument_ for a template type-parameter.
to
The following types shall not be used as a _template-argument_for a template type-parameter:
- a type whose name has no linkage
- an unnamed class or enumeration type that has no name for linkage purposes (9.2.4 [dcl.typedef])
- a cv-qualified version of one of the types in this list
- a type created by application of declarator operators to one of the types in this list
- a function type that uses one of the types in this list