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 8 February 2016 at 16:05, H.J. Lu wrote:
> My understanding is
>
> A type that is standard-layout means that it orders and packs its
> members in a way that is compatible with C.
>
> What is the corresponding compatible type in C?

An empty structure, such as struct A.

One of the requirements for standard-layout classes is "has all
non-static data members and bit-fields in the class and its base
classes first declared in the same class" so standard layout classes
are allowed to have base classes, as long as either the base class is
empty (so doesn't alter layout) or the derived class doesn't add
members (so has the same layout as the base). If neither the base
class is an empty record, and the derived class doesn't add any
non-static data members or bit-fields, then the base class should be
an empty record too.


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