<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2038</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="2038"></A><H4>2038.
  
Document C++14 incompatibility of new braced deduction rule
</H4>
<B>Section: </B>C.4&#160; [<A href="https://wg21.link/diff.cpp14">diff.cpp14</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD4
 &#160;&#160;&#160;

 <B>Submitter: </B>Jonathan Caves
 &#160;&#160;&#160;

 <B>Date: </B>2014-11-08<BR>


<P>[Adopted at the February, 2016 meeting.]</P>

<P>The adoption of document N3922 at the November, 2014 meeting
introduces a new incompatibility that should be documented in Annex
Clause Annex C [<A href="https://wg21.link/diff">diff</A>]:</P>

<PRE>
  int x1 = 1;
  auto x2{x1};    //<SPAN CLASS="cmnt"> Is now </SPAN>int<SPAN CLASS="cmnt"> before was </SPAN>std::initializer&lt;int&gt;
</PRE>

<P><B>Proposed resolution (September, 2015):</B></P>

<P>Insert the following as a new section following
C.4.2 [<A href="https://wg21.link/diff.cpp14.lex">diff.cpp14.lex</A>]:</P>

<BLOCKQUOTE>

<TABLE STYLE="WIDTH:100%">
<TR>
<TD><H2><INS>C.4.2 Clause 7: Declarations</INS></H2></TD>
<TD ALIGN="RIGHT"><H2><INS>[diff.cpp14.dcl]</INS></H2></TD>
</TR>
</TABLE>

<P>
<INS>9.2.9.7 [<A href="https://wg21.link/dcl.spec.auto">dcl.spec.auto</A>]<BR>
<B>Change:</B> <TT>auto</TT> deduction from <I>braced-init-list</I><BR>
<B>Rationale:</B> More intuitive deduction behavior<BR>
<B>Effect on original feature:</B> Valid C++14 code may fail to compile
or may change meaning in this International Standard. For example:</INS>
</P>

<PRE>
<INS>  auto x1{1};    //<SPAN CLASS="cmnt"> Was </SPAN>std::initializer_list&lt;int&gt;<SPAN CLASS="cmnt">, now </SPAN>int
  auto x2{1, 2}; //<SPAN CLASS="cmnt"> Was </SPAN>std::initializer_list&lt;int&gt;<SPAN CLASS="cmnt">, now ill-formed</SPAN></INS>
</PRE>

</BLOCKQUOTE>

<BR><BR>
</BODY>
</HTML>
