<div dir="ltr">Drop the std::move (this would incorrectly move in this case, I think:<br><br>std::string s;<br>ErrorOr<std::string> g = s;<br><br>I think? Perhaps you could add a test case for a case like that to ensure the move does not occur (you'd need a type that recorded its move operations, etc)<br><br>Other than that, please commit</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 3, 2016 at 6:58 PM, Nick Lewycky via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</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">The attached patch changes ErrorOr to make this code:<div><br></div><div>  ErrorOr<string> test() { return "literal"; }</div><div><br></div><div>work. Without this patch it fails because it would require two user-defined conversions in a row. Please review!</div><div><br></div><div>I'm not sure whether it's correct to describe this as "perfect forwarding"?<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Nick<br></div><div><br></div></font></span></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>