[cxx-abi-dev] Transfer modes for parameters and return values
Jason Merrill
jason at redhat.com
Wed Jun 3 21:26:15 UTC 2009
David Vandevoorde wrote:
> Hello again,
>
> In 3.1.1 and 3.1.4, the ABI specifies that "by value" class type
> parameters and class type return values are passed via the address of a
> reference if the class type has
> (a) a nontrivial destructor, or
> (b) a nontrivial copy constructor.
>
> Should we now also add to that:
> (c) a (nontrivial) move constructor
> ?
I'm not sure. We need to pass by reference in the case of a nontrivial
copy constructor because it's invalid to do a bitwise copy in that case.
We need to do it in the case of a nontrivial destructor so that the
caller can control when the destructor is run depending on copy elision.
Neither of those really applies to the move constructor.
Jason
More information about the cxx-abi-dev
mailing list