This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/81051] virtual base access during construction crashes


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81051

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
            Summary|lambda capture of this in   |virtual base access during
                   |initialization list with    |construction crashes
                   |virtual inheritance         |

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
This doesn't seem to be a lambda issue, as this example fails similarly:

struct A
{
  int Func() { return x++; }
  int x = 5;
};

struct B
{
  B(int) {}
};

struct Derived : public virtual A, public B
{
  friend int f (Derived *p) { return p->Func(); }
  Derived()
    : A()
    , B(f(this))
  {
  }
};

int main()
{
  Derived d;
}

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