<div dir="ltr">The problem in PR20218 is visible in its notes:<div><br></div><div><pre class="" id="comment_text_0" 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><div class="gmail_extra"><br><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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="">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 class="">

<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></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 class=""><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>