[cxx-abi-dev] Transfer modes for parameters and return values

John McCall rjmccall at apple.com
Fri Dec 7 00:10:28 UTC 2012


On Dec 6, 2012, at 3:30 PM, Richard Smith <richardsmith at google.com> wrote:
> We also have a minor ABI incompatibility between C++03 and C++11 due to the change to use the selected constructor when determining triviality of a copy constructor:
> 
> struct A {
>   template<typename T> A(T&);
> };
> struct B {
>   mutable A a;
> };
> 
> B has a trivial copy constructor in C++03, but a non-trivial copy constructor in C++11.

Very interesting.  I can't remember ever considering the effect of 'mutable' on implicitly-defined copy constructors.

Since the intended behavior of B's copy constructor was always non-trivial here (from a practical perspective), I'm tentatively okay with (1) calling this a flaw in C++98 and (2) changing the ABI to pass and return this indirectly.  Clearly, though, that should happen regardless of language mode, which may be an implementation problem.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20121206/6fa0e38c/attachment.html>


More information about the cxx-abi-dev mailing list