[cxx-abi-dev] Transfer modes for parameters and return values
Jason Merrill
jason at redhat.com
Tue Nov 27 13:47:22 UTC 2012
On 11/26/2012 04:09 PM, Richard Smith wrote:
> Suggestion for core language:
>
> When an object of class type C is passed to or returned from a function,
> if C has a trivial, accessible copy or move constructor that is not
I don't think we want to check accessibility; the calling convention for
a type needs to be the same no matter where it's called from, and I
think it's fine for the compiler to use a private trivial copy
constructor that isn't deleted.
> deleted, and has no non-trivial copy constructors, move constructors,
Incidentally, if we're making this latitude explicit, we don't
necessarily need to involve move constructors at all. I don't have much
of an opinion either way.
> nor destructors, implementations are permitted to perform an additional
> copy or move of the object using the trivial constructor (even if it
> would not be selected by overload resolution to perform a copy or move
> of the object). [Note: This latitude is granted to allow objects of
> class type to be passed to or returned from functions in registers --
> end note]
I think when we added implicit move constructors we decided against
talking about "copy or move" of an object, since moving is a special
case of copying.
Jason
More information about the cxx-abi-dev
mailing list