RFC: Update Intel386, x86-64 and IA MCU psABIs for passing/returning empty struct

H.J. Lu via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 20 18:54:28 PST 2016


On Sat, Feb 20, 2016 at 4:57 PM, Matthijs van Duin
<matthijsvanduin at gmail.com> wrote:
> On 20 February 2016 at 23:35, H.J. Lu <hjl.tools at gmail.com> wrote:
>> Can a compiler tell if a copy constructor or destructor is trivial
>> from the class declaration without function body?
>
> Yes, the mere presence of the declaration suffices to render it
> non-trivial (unless explicitly declared "= default" like I did with
> the default constructor, in which case there's no function body).

How about this?

An empty type is a type where it and all of its subobjects (recursively)
are of class, structure, union, or array type.  An empty type may only
have static member functions, default  constructor, default copy
constructor, default copy assignment operator or default destructor.

No memory slot nor register should be used to pass or return an
object of empty type.

-- 
H.J.


More information about the cfe-commits mailing list