<div dir="ltr"><div>I'm not really an overload resolution expert, so I could be wrong.  Anyway, please file a bug report (<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a>), and our overload resolution experts will take a look. :)  </div>
<div><br></div><div>-Eli</div><div><br></div>On Wed, Sep 25, 2013 at 6:34 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Actually it should have not thrown error at all. it works fine with gcc. And the part of code which you mentioned is not getting hit at all. Maybe some difference in parsing is there.<br>
</div><div class="gmail_extra"><div><div class="h5">
<br><br><div class="gmail_quote">On Wed, Sep 25, 2013 at 5:29 AM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><div>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></div><div class="gmail_extra">

<div class="gmail_quote"><div><div>
<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><font color="#888888"><br></font></span></div><div><br></div></div></blockquote><br></div></div>See C++11 [over.best.ics]p4.  We could probably improve the diagnostic here, though; please file a bug.</div>

<span><font color="#888888">
<div class="gmail_quote"><br></div><div class="gmail_quote">-Eli</div></font></span></div></div>
</blockquote></div><br><br clear="all"><br></div></div><div class="im">-- <br><div>Thanx & Regards <br></div>
<div><b>Mayur Pandey </b><br></div>
</div><div style>Senior Software Engineer</div>
<div>Samsung India Software Operations<br>Bangalore<br><a href="tel:%2B91-9742959541" value="+919742959541" target="_blank">+91-9742959541</a><br><font color="#3333ff"></font><font color="#3333ff"> <br></font></div>
<div> </div>
<div> </div>
</div>
</blockquote></div><br></div></div>