Title
Document C++14 incompatibility of new braced deduction rule
Status
cd4
Section
C.4 [diff.cpp14]
Submitter
Jonathan Caves

Created on 2014-11-08.00:00:00 last changed 86 months ago

Messages

Date: 2015-09-15.00:00:00

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]

9.2.9.7 [dcl.spec.auto]
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
Date: 2016-02-15.00:00:00

[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>
History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: tentatively ready -> cd4
2015-11-10 00:00:00adminsetmessages: + msg5618
2015-11-10 00:00:00adminsetstatus: drafting -> tentatively ready
2014-11-08 00:00:00admincreate