<div dir="ltr">On Mon, Jul 14, 2014 at 10:39 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</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:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="">On Mon, Jul 14, 2014 at 5:15 AM, Ehsan Akhgari <span dir="ltr"><<a href="mailto:ehsan.akhgari@gmail.com" target="_blank">ehsan.akhgari@gmail.com</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 class="gmail_extra"><div class="gmail_quote">
<div>On Sun, Jul 13, 2014 at 9:04 PM, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_extra">The problem in PR20218 is visible in its notes:<div>
<br></div><div><pre style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">test.cpp(4,3) : note: candidate constructor [with X = int, Y = void ()]
pair(X&&, Y&&);
^
</pre></div><div>This deduction is wrong. We should get Y = void (&)(). Presumably the 'deduce an lvalue reference if an rvalue reference to T binds to an lvalue' rule isn't being applied appropriately in the case where the lvalue is an overload set.</div>
</div></blockquote></div><div><br>Thanks, Richard! Given the above, and also r212916, do we want to still take my patch here?<br clear="all"></div></div></div></div></blockquote><div><br></div></div><div>Does it change the diagnostic in this case (from 'no overload [...]' to 'no known conversion from 'void ()' to 'int'):</div>
<div><br></div><div>template<typename T> void f();</div><div>int g(int);</div><div>int k = g(f<int>);<br></div><div><br></div><div>If so, please go ahead with that as a testcase.</div></div></div></div></blockquote>
<div><br></div><div>No, both before and after, I get:<br><br>$ ./bin/clang-cl -c test.cpp<br>test.cpp(3,9) : error: no matching function for call to 'g'<br>int k = g(f<int>);<br> ^<br>test.cpp(2,5) : note: candidate function not viable: no overload of 'f' matching 'int' for 1st argument<br>
int g(int);<br> ^<br>1 error generated.<br> <br></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 class="gmail_extra"><div class="gmail_quote">
<div><div class="h5"><div><br></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 class="gmail_extra"><div class="gmail_quote"><div><div>--<br>Ehsan<br><<a href="http://ehsanakhgari.org/" target="_blank">http://ehsanakhgari.org/</a>></div>
<br> </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 class="gmail_extra">
<br><div class="gmail_quote">On Tue, Jul 8, 2014 at 3:13 PM, Ehsan Akhgari <span dir="ltr"><<a href="mailto:ehsan.akhgari@gmail.com" target="_blank">ehsan.akhgari@gmail.com</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>On Tue, Jul 8, 2014 at 6:05 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><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 class="gmail_extra"><div class="gmail_quote">
<div>On Sun, Jul 6, 2014 at 12:16 PM, Ehsan Akhgari <span dir="ltr"><<a href="mailto:ehsan.akhgari@gmail.com" target="_blank">ehsan.akhgari@gmail.com</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">Hi doug.gregor,<br>
<br>
If during constructing a standard conversion sequence, we resolve an<br>
overload, we need to adjust the from type in the SCS according to the<br>
resolved operator.<br>
<br>
I found this bug when debugging PR20218. It doesn't completely fix that<br>
test case though.<br></blockquote><div><br></div></div><div>The fix looks correct, but please provide some kind of test case for this patch (even if it doesn't solve PR20218's test case).</div></div></div>
</div></blockquote><div><br></div></div><div>I tried to do that, but I wasn't able to write a simpler test case similar to that of PR20218 which would have an observable outcome different after this patch... Any ideas how I can write a good test case for this?<br>
</div><div><br>Thanks!<br clear="all"><div>--<br>Ehsan<br><<a href="http://ehsanakhgari.org/" target="_blank">http://ehsanakhgari.org/</a>></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 class="gmail_extra"><div class="gmail_quote"><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>
<a href="http://reviews.llvm.org/D4402" target="_blank">http://reviews.llvm.org/D4402</a><br>
<br>
Files:<br>
lib/Sema/SemaOverload.cpp<br>
<br>
Index: lib/Sema/SemaOverload.cpp<br>
===================================================================<br>
--- lib/Sema/SemaOverload.cpp<br>
+++ lib/Sema/SemaOverload.cpp<br>
@@ -1462,6 +1462,7 @@<br>
// We were able to resolve the address of the overloaded function,<br>
// so we can convert to the type of that function.<br>
FromType = Fn->getType();<br>
+ SCS.setFromType(FromType);<br>
<br>
// we can sometimes resolve &foo<int> regardless of ToType, so check<br>
// if the type matches (identity) or we are converting to bool<br>
<br></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></div>
</blockquote></div></div><br></div></div>
</blockquote></div><br></div><div><div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>