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
Mon Feb 8 09:58:10 PST 2016


On Mon, Feb 8, 2016 at 7:59 AM, Jonathan Wakely <jwakely.gcc at gmail.com> wrote:
>>> A type is a standard-layout type, or it isn't.
>>
>> How about "An empty record is standard-layout Plain Old Data (POD)
>> type and ..."?
>
> That's redundant, all POD types are standard-layout types.
>

Apparently, not all standard-layout types are POD types.  GCC has

/* Nonzero means that this class type is not POD for the purpose of layout
   (as defined in the ABI).  This is different from the language's POD.  */
CLASSTYPE_NON_LAYOUT_POD_P

and

/* Nonzero means that this class type is a non-standard-layout class.  */
#define CLASSTYPE_NON_STD_LAYOUT

They aren't the same.

struct A { };
struct B { };
struct C : A, B { };

C is a standard-layout type, but not a standard-layout POD type.

-- 
H.J.


More information about the cfe-commits mailing list