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 13:54, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Feb 7, 2016 at 12:52 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
> The standard-layout POD is well defined:
>
> https://en.wikipedia.org/wiki/C%2B%2B11#Modification_to_the_definition_of_plain_old_data
>
> Here is the updated proposal for  Intel386, x86-64 and IA MCU psABIs:
>
> 1. "collection".  A collection is a structure, union or C++ class.

These are all "class types". Why invent a new term?

> 2. "empty collection".  An empty collection is:
>    a. A collection without member.  Or

What about base classes?

What about bit-fields of length 0?

>    b. A collection with only empty collections.  Or

What does "with" mean? Only members, or bases too?

>    c. An array of empty collections.
> 3. "empty record".  An empty record is Plain Old Data (POD) for the purpose
>    of standard-layout and

"For the purposes of standard-layout" doesn't mean anything.

A type is a standard-layout type, or it isn't.

Do you mean "An empty record is a standard-layout type and..."

>    a. A collection without member.  Or
>    b. A collection with only empty collections.

?



The C++ standard defines the std::is_empty<T> trait as true when:
"T is a class type, but not a union type, with no non-static data
members other than bit-fields of length 0, no virtual member
functions, no virtual base classes, and no base class B for which
is_empty<B>::value is false."



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


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