This is the mail archive of the gcc-patches@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: C++ PATCH: Fix ctor vtables for extreme virtual inheritance


Jason Merrill wrote:
> 
> The old code in dfs_accumulate_vtbl_inits failed to consider the
> possibility that a lost virtual base could still share its vptr with
> another lost virtual base within the sub-hierarchy of the base under
> construction.  This patch fixes that.
Thanks for merging that. I've installed the attached two test cases on
both branch and mainline.

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com>

// Bug 3006. Constructor vtables were wrong.

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

class B : public virtual A {};
class C : public virtual B {};
class D1 : public virtual C {};
class D2 : public virtual C {};
class E
  : public virtual D1,
    public virtual D2
{
};


int
main(int argc, char* argv[])
{
  new E;
  return 0;
}
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com>

// Bug 3061. Constructor vtables were wrong.

class A_base {
  public:
  virtual void foo() { }
};
class A_skel : virtual public A_base { };

class B_base : virtual public A_base { };
class B_skel : virtual public B_base, virtual public A_skel { };

class C_base : virtual public B_base { };
class C_skel : virtual public C_base, virtual public B_skel { };

class D_base : virtual public C_base { };
class D_skel : virtual public D_base, virtual public C_skel { };

class D_impl : virtual public D_skel { };

int main()
{
  D_impl i;
}

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