<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 9, 2018 at 2:52 AM, José Luis March Cabrelles via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:12.8px">Hi, </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">my name is José Luis, I have a question regarding backwards compatibility of proposal N3922 for C++17:</div><div style="font-size:12.8px"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html" target="_blank">http://www.open-std.org/jtc1/s<wbr>c22/wg21/docs/papers/2014/n392<wbr>2.html</a></div></div></blockquote><div><br></div><div>There's more information available in the papers referenced by n3922: "<span style="color:rgb(0,0,0);font-family:Times;font-size:medium">For background information see</span><span style="color:rgb(0,0,0);font-family:Times;font-size:medium"> </span><a href="http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3681.html" style="font-family:Times;font-size:medium">N3681</a><span style="color:rgb(0,0,0);font-family:Times;font-size:medium">, "Auto and braced-init-lists", by Voutilainen, and N3912, "Auto and braced-init-lists, continued", also by Voutilainen."</span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">That change introduces a new incompatibility with C++14 and C++11, as it is stated in the C++17 Standard:</div><div style="font-size:12.8px">C.4.3 Clause 10: declarations [diff.cpp14.dcl.dcl]</div><div style="font-size:12.8px"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2038" target="_blank">http://www.open-std.org/jtc1/s<wbr>c22/wg21/docs/cwg_defects.html<wbr>#2038</a><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Is it considered a New Feature or a Defect Report?</div></div></blockquote><div><br></div><div>Quoting from n3922: "<span style="color:rgb(0,0,0);font-family:Times;font-size:medium">Direction from EWG is that we consider this a defect in C++14."</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am asking this because Clang (and GCC) adopted the new rule not only for C++17 but also for C++14 and C++11. In fact, I found this comment: </div><span style="font-size:12.8px">This is a backwards-incompatible change that is applied to all language versions that allow type deduction from auto (per the request of the C++ committee).</span><div style="font-size:12.8px"><a href="http://clang.llvm.org/cxx_status.html#n3922" target="_blank">http://clang.llvm.org/cxx_stat<wbr>us.html#n3922</a><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Can someone please confirm and explain why the C++ committee requested compiler developers to treat this new rule as a Defect Report and, hence, to fix/change it also in C++11 and C++14?</div></div></blockquote><div><br></div><div>Ville Voutilainen's n3912.html gives more information on that.</div><div><br></div><div>n3681.html mentions the example of init-captures.  Using the original wording of C++14, `[a{b}]` would not have deduced `a` as a copy of `b`, although it was the intent of "uniform initialization" that it should do so.  When the rules as written fail to capture the intent in basic cases, the committee might consider it a defect, as in this case.</div><div><br></div><div>-- James</div></div></div></div>