This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Double abstract class Inheritance concern.
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Tiago Stein <tiago at lisha dot ufsc dot br>
- Cc: gcc at gcc dot gnu dot org
- Date: 28 Mar 2004 23:21:11 -0300
- Subject: Re: Double abstract class Inheritance concern.
- Organization: Red Hat Global Engineering Services Compiler Team
- References: <65184.200.138.253.131.1080515997.squirrel@www.lisha.ufsc.br>
On Mar 28, 2004, Tiago Stein <tiago@lisha.ufsc.br> wrote:
> class A{ };
> class B :public A{ };
> class C: public A{ int g; };
> class D: public B, public C { unsigned int foo; };
> Why sizeof class D is 12? Should not be 8? Why the extra size from the
> empty classes is not eliminated this time? Is this due to any rules in the
> standard?
D::B::A and D::C::A must have different addresses.
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}