[Bug c++/37715] Different class sizes with public/private and alignments
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Oct 3 20:47:00 GMT 2008
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-10-03 20:46 -------
In the private case, A is a non-POD so _c can fit tail part of A. So the
sizeof(M) is 16 bytes.
In the public case, A is a POD so _c is not allowed to be in the tail part of A
(as required by the C++ standard), so the sizeof(M) is 2 * 16. The sizeof (_c)
is 1 as required by the C++ standard.
For the non aligned case, there is no tail part of A for the non POD case as
the alignment and size are equal.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37715
More information about the Gcc-bugs
mailing list