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

2024-12-19


2049. List initializer in non-type template default argument

Section: 13.4.3  [temp.arg.nontype]     Status: DRWP     Submitter: Ville Voutilainen     Date: 2014-11-20

[ Resolved by paper P2308R1 (Template parameter initialization), adopted in November, 2023. ]

According to 13.4.3 [temp.arg.nontype] paragraph 1,

A template-argument for a non-type template-parameter shall be a converted constant expression (7.7 [expr.const]) of the type of the template-parameter.

This does not permit an example like:

  template <int* x = {}> struct X {};

which seems inconsistent.

See also issues 2450 and 2459.