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


1159. Class and enumeration definitions in template aliases

Section: 13.7.8  [temp.alias]     Status: C++11     Submitter: US     Date: 2010-08-03

[Voted into the WP at the November, 2010 meeting.]

N3092 comment US 74

An alias-declaration allows a class or enumeration type to be defined in its type-id (9.2.9 [dcl.type] paragraph 3). However, it's not clear that this is desirable when the alias-declaration is part of a template alias:

    template<typename T> using A =
      struct { void f(T) { } };

Proposed resolution (August, 2010):

Change 9.2.9 [dcl.type] paragraph 3 as follows:

...A type-specifier-seq shall not define a class or enumeration unless it appears in the type-id of an alias-declaration (9.2.4 [dcl.typedef]) that is not the declaration of a template-declaration.