<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jul 25, 2015 at 6:57 AM, Dimitry Andric <span dir="ltr"><<a href="mailto:dimitry@andric.com" target="_blank">dimitry@andric.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dim added inline comments.<br>
<span class=""><br>
================<br>
Comment at: include/__config:724<br>
@@ -719,1 +723,3 @@<br>
+#endif<br>
+<br>
 #ifndef _LIBCPP_HAS_NO_ASAN<br>
----------------<br>
</span><span class="">mclow.lists wrote:<br>
> I think that this needs more exploration; someone needs to look at the codegen.<br>
><br>
>      return x;<br>
><br>
> is different from:<br>
><br>
>      return (x);   // this is an expression<br>
><br>
> I suspect that only one will trigger RVO.<br>
><br>
</span>Would you really think so?  I would think the parentheses are superfluous, and can be removed by parsing stages before it gets to RVO.  But I will try to check the codegen anyway.<br></blockquote><div><br></div><div>Please file a bug if you find any cases where the parenthesized and non-parenthesized form behave differently wrt RVO / NRVO.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Alternatively, since the macro is for 'internal use only', we might try to just remove the parentheses, e.g.:<br>
<br>
    #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES<br>
    #  define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)<br>
    #else<br>
    #  define _LIBCPP_EXPLICIT_MOVE(x) x<br>
    #endif<br>
<br>
It is a bit ugly, but at least the code itself does not have to be littered with #ifdefs.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11394&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=YweN40EUfrVmkIbQEcnMYujybOj_ITPuk0lITpstzdM&s=A_760azcAw6xw0mhGuQIBYWYRB30Hn8zvICBB6je0aI&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D11394</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>