This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112c. See for the official list.


2038. Document C++14 incompatibility of new braced deduction rule

Section: C.4  [diff.cpp14]     Status: CD4     Submitter: Jonathan Caves     Date: 2014-11-08

[Adopted at the February, 2016 meeting.]

The adoption of document N3922 at the November, 2014 meeting introduces a new incompatibility that should be documented in Annex Clause Annex C [diff]:

  int x1 = 1;
  auto x2{x1};    // Is now int before was std::initializer<int>

Proposed resolution (September, 2015):

Insert the following as a new section following C.4.2 [diff.cpp14.lex]:

C.4.2 Clause 7: Declarations

[diff.cpp14.dcl] []
Change: auto deduction from braced-init-list
Rationale: More intuitive deduction behavior
Effect on original feature: Valid C++14 code may fail to compile or may change meaning in this International Standard. For example:

  auto x1{1};    // Was std::initializer_list<int>, now int
  auto x2{1, 2}; // Was std::initializer_list<int>, now ill-formed