On Tue, 26 Jan 2016, H.J. Lu wrote:

On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill <ja...@redhat.com> wrote:
On 12/14/2015 05:08 PM, H.J. Lu wrote:

+  if (abi_version_at_least (10))
+    TYPE_EMPTY_RECORD (t) = is_really_empty_class (t);


This should use is_empty_class or CLASSTYPE_EMPTY_P.  We don't want to
change how classes with just a vptr are passed.

Otherwise, it looks OK to me.

Is true_type an empty class here?  is_empty_class returns false
on this:

It isn't empty in the usual C++ sense (we can't apply the empty base optimization to something that derives from it, for instance), or the one described in the itanium ABI (the relevant one here I guess). On the other hand, it is rather useless to pass it by value, so a different notion of empty might have been useful when the ABI was defined...

[hjl@gnu-skl-1 gcc]$ cat x.cc
struct dummy { };
struct true_type { struct dummy i; };

extern true_type y;
extern void xxx (true_type c);

void
yyy (void)
{
 xxx (y);
}
[hjl@gnu-skl-1 gcc]$

--
Marc Glisse

Reply via email to