This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Mon, Feb 8, 2016 at 7:59 AM, Jonathan Wakely <jwakely.gcc@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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]