<div dir="ltr">On Mon, Sep 23, 2013 at 11:43 PM, Mayur Pandey <span dir="ltr"><<a href="mailto:mayurthebond@gmail.com" target="_blank">mayurthebond@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>for the following code:<br><br>struct X<br>
{<br>  X();<br>};<br><br>struct Y<br>{<br>  operator X() const;<br>};<br><br>X a = { Y() };    // reports error: no matching constructor for initialization of 'X'<br>
X aa = Y();  // works fine<br><br><br></div>clang when compiled with std=c++11 gives compilation errors as:<br><br><br>testfile.C:11:3: error: no matching constructor for initialization of 'X'<br>X a = { Y() };    // reports error: no matching constructor for initialization of 'X'<br>

  ^   ~~~~~~~<br>testfile.C:1:8: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'Y' to 'const X &' for 1st<br>      argument<br>struct X<br>       ^<br>

testfile.C:1:8: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'Y' to 'X &&' for 1st<br>      argument<br>struct X<br>       ^<br>testfile.C:3:3: note: candidate constructor not viable: requires 0 arguments, but 1 was provided<br>

  X();<br>  ^<br>1 error generated.<span class=""><font color="#888888"><br></font></span></div><div><br></div></div></blockquote><br>See C++11 [over.best.ics]p4.  We could probably improve the diagnostic here, though; please file a bug.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">-Eli</div></div></div>