<p dir="ltr">On 20 Feb 2016 10:01 p.m., "H.J. Lu" <<a href="mailto:hjl.tools@gmail.com">hjl.tools@gmail.com</a>> wrote:<br>
><br>
> On Sat, Feb 20, 2016 at 9:47 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> > On 20 Feb 2016 6:54 p.m., "H.J. Lu" <<a href="mailto:hjl.tools@gmail.com">hjl.tools@gmail.com</a>> wrote:<br>
> >><br>
> >> On Sat, Feb 20, 2016 at 4:57 PM, Matthijs van Duin<br>
> >> <<a href="mailto:matthijsvanduin@gmail.com">matthijsvanduin@gmail.com</a>> wrote:<br>
> >> > On 20 February 2016 at 23:35, H.J. Lu <<a href="mailto:hjl.tools@gmail.com">hjl.tools@gmail.com</a>> wrote:<br>
> >> >> Can a compiler tell if a copy constructor or destructor is trivial<br>
> >> >> from the class declaration without function body?<br>
> >> ><br>
> >> > Yes, the mere presence of the declaration suffices to render it<br>
> >> > non-trivial (unless explicitly declared "= default" like I did with<br>
> >> > the default constructor, in which case there's no function body).<br>
> >><br>
> >> How about this?<br>
> >><br>
> >> An empty type is a type where it and all of its subobjects (recursively)<br>
> >> are of class, structure, union, or array type.  An empty type may only<br>
> >> have static member functions, default  constructor, default copy<br>
> >> constructor, default copy assignment operator or default destructor.<br>
> ><br>
> > No, that's the wrong rule still. Please leave the C++ rule here to the C++<br>
> > ABI rather than trying to reinvent it. Whether a type is empty is completely<br>
> > orthogonal to whether it must be passed through memory for C++ ABI /<br>
> > semantics reasons.<br>
><br>
> What is the correct wording?  The last one:<br>
><br>
> An empty type is a type where it and all of its subobjects (recursively)<br>
> are of class, structure, union, or array type.<br>
><br>
> doesn't cover "trivially-copyable".</p>
<p dir="ltr">That's correct. Whether a type is trivially copyable is unrelated to whether it is empty.<br>
</p>