http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

--- Comment #9 from vagran <vagran.ast at gmail dot com> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to H.J. Lu from comment #4)
> > Is this test valid? BTW, clang works fine on x86.
> 
> No this testcase is not valid at all.  See
> http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Empty-Structures.html#Empty-
> Structures where it is documented it is not valid.

How it proves that the test case is invalid? Independently on what size has
empty structure the called function absolutely legally can expect it receives
the values which were passed by the caller. A compiler should care it works for
both C and C++. Am I wrong?

Also as I remember in C++ size of empty structure is sizeof(char) except the
case some class is derived from the empty structure. In this case it adds no
overhead to the size of the derived class itself (thus virtually has zero size
in this case).

Reply via email to