On Sat, Jul 25, 2015 at 6:57 AM, Dimitry Andric <dimi...@andric.com> wrote:

> dim added inline comments.
>
> ================
> Comment at: include/__config:724
> @@ -719,1 +723,3 @@
> +#endif
> +
>  #ifndef _LIBCPP_HAS_NO_ASAN
> ----------------
> mclow.lists wrote:
> > I think that this needs more exploration; someone needs to look at the
> codegen.
> >
> >      return x;
> >
> > is different from:
> >
> >      return (x);   // this is an expression
> >
> > I suspect that only one will trigger RVO.
> >
> 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.
>

Please file a bug if you find any cases where the parenthesized and
non-parenthesized form behave differently wrt RVO / NRVO.


> Alternatively, since the macro is for 'internal use only', we might try to
> just remove the parentheses, e.g.:
>
>     #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
>     #  define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
>     #else
>     #  define _LIBCPP_EXPLICIT_MOVE(x) x
>     #endif
>
> It is a bit ugly, but at least the code itself does not have to be
> littered with #ifdefs.
>
>
> http://reviews.llvm.org/D11394
>
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to