[cxx-abi-dev] Passing an empty class by value

Jason Merrill jason at redhat.com
Thu Jul 21 17:53:31 UTC 2016


On Fri, Feb 26, 2016 at 11:01 PM, Jason Merrill <jason at redhat.com> wrote:
> I also notice that the ABI says "If the base ABI does not specify rules for
> empty classes, then an empty class has size and alignment 1."

It also says,

"Empty classes will be passed no differently from ordinary classes....
The contents of the single byte parameter slot are unspecified, and
the callee may not depend on any particular value."

and

"A result of an empty class type will be returned as though it were a
struct containing a single char, i.e. struct S { char c; };. The
actual content of the return register is unspecified."

If we want the (new) psABI wording to override this, we need to update
these rules by referring to the base ABI in these passages as well.

Jason


More information about the cxx-abi-dev mailing list