On Feb 9, 2014, at 6:17 PM, Richard Smith <[email protected]> wrote:
> On 9 February 2014 05:37, Hubert Tong <[email protected]> wrote:
> Core Issue 1590 mentions that the trivial copy or move constructor should be 
> non-deleted and accessible.
> Replacing the pair of copy constructors below with private, deleted copy and 
> move constructors seems to make GCC avoid the "magic" copy, but not Clang.
> Which compiler has the preferred behaviour?
> 
> I think GCC does, whereas Clang obeys the current description of the ABI.
> 
> Under the current wording of core issue 1590, we're not allowed to perform a 
> 'trivial' copy here. I think we should update the ABI document (in 3.1.1/1) 
> to make this work (perhaps something equivalent to replacing "non-trivial" 
> with "non-trivial, non-public, or deleted" each time it occurs).

gcc’s rule appears to just be “non-trivial or deleted”, which I think is 
reasonable for the ABI to adopt.  Would you like to write up a proposal for 
that?

“Accessible” does not mean “public”.  That’s a standards bug: we need to be 
able to decide the ABI signature of a function at its point of declaration, not 
have it be dependent on whether there exist (or might exist) calls to it which 
would not be allowed to use a privately-defaulted trivial copy constructor.

Note that the pre-C++11 idiom for suppressing the copy-constructor would also 
make it non-trivial, so that’s okay.

John.
_______________________________________________
cxx-abi-dev mailing list
[email protected]
http://sourcerytools.com/cgi-bin/mailman/listinfo/cxx-abi-dev

Reply via email to