<div dir="ltr"><div><div>Hi Richard,<br><br></div>Thanks for your review. Committed as r206133 with suggested change. Thanks.<br><br></div>Logan<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 12, 2014 at 3:45 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</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">Sorry for the delay!<div><br></div><div><div>+ // but the type cast should be considered as failure.</div>
<div>+</div><div>+ OverloadExpr* oe = OverloadExpr::find(SrcExpr.get()).Expression;</div>
<div>+ Self.Diag(OpRange.getBegin(), diag::err_bad_cstyle_cast_overload)</div><div>+ << oe->getName() << DestType << OpRange</div><div>+ << oe->getQualifierLoc().getSourceRange();</div>
<div>+ Self.NoteAllOverloadCandidates(SrcExpr.get());</div></div><div><br></div><div>Some tiny typographical things here: no blank line between the comment and the code, put the * on the right not on the left, and 'oe' should be 'OE'. Otherwise, this looks good to me. Do you need someone to commit it for you?</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Thu, Mar 27, 2014 at 9:51 AM, Logan Chien <span dir="ltr"><<a href="mailto:tzuhsiang.chien@gmail.com" target="_blank">tzuhsiang.chien@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Ping?<br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Mar 17, 2014 at 11:59 PM, Logan Chien <span dir="ltr"><<a href="mailto:tzuhsiang.chien@gmail.com" target="_blank">tzuhsiang.chien@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>Hi,<br><br>It seems that if the C-style type cast is applied to the overloaded function and the destination type is function type, then Clang will crash with assertion failure. For example,<br>
</div> <br>
void foo(int);<br> void foo(int, int);<br> void bar() {<br> typedef void (ft)(int);<br> ft p = (ft)foo;<br> }<br> <br>In this case, the overloaded function foo will be cast to a function type, which should be considered as an error. But, unfortunately, since the function resolution is using canonical type, the matched function will be returned, and raise SEGV at lib/Sema/SemaCast.cpp:2101.<br>
<br>This patch fixes this issue by removing the assertion and add some error diagnostics as the one in static_cast. Please have a look. Thanks.<span><font color="#888888"><br><br>Logan<br></font></span></div>
</blockquote></div><br></div>
</div></div><br></div></div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>