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

2024-03-20


2374. Overly permissive specification of enum direct-list-initialization

Section: 9.4.5  [dcl.init.list]     Status: C++20     Submitter: Shafik Yaghmour     Date: 2018-02-18

[Adopted as a DR at the November, 2019 meeting.]

According to 9.4.5 [dcl.init.list] bullet 3.8,

The conversion T(v) is too broad, allowing, e.g., conversion from a different scoped enumeration type. The intent presumably was only to allow v to be a value of T's underlying type.

Notes from the October, 2018 teleconference:

CWG agreed with the suggested direction, along the lines of “...can be implicitly converted to the underlying type of T...”

Proposed resolution (May, 2019): [SUPERSEDED]

Change bullet 3.8 of 9.4.5 [dcl.init.list] as follows:

Proposed resolution (October, 2019):

Change bullet 3.8 of 9.4.5 [dcl.init.list] as follows: