This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: vtbl layout


> I did my research and found out the above details. One thing I
> couldn't completely figure out is how is the 'adjustment to the
> front of the complete object' ever used. Can anyone post a code
> fragment whose generated assembler actually uses the first slot of
> the vtable. Or can anyone point me in the right direction so that I
> can come up with the code myself?

Consider

struct A{
  int i;
  virtual ~A();
};

struct B{
  int j;
  virtual ~B();
};

struct C: virtual A, virtual B{
  virtual ~C();
};

C::~C(){}

on i596-pc-linux-gnu, I get

__vt_1C.1B:
	.long -16
	.long __tf1C
	.long __thunk_16__._1C

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]