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

2024-04-18


22. Template parameter with a default argument that refers to itself

Section: 13.8.4  [temp.dep.res]     Status: TC1     Submitter: unknown     Date: unknown

13.2 [temp.param] paragraph 13 says:

The scope of a template-parameter extends from its point of declaration until the end of its template. In particular, a template-parameter can be used in the declaration of subsequent template-parameters and their default arguments.
Is the following well-formed?
    template<class U = U> class X { ... };

[Note: this issue is resolved by the resolution of issue 187.]