This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81051] virtual base access during construction crashes
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Aug 2017 22:15:53 +0000
- Subject: [Bug c++/81051] virtual base access during construction crashes
- Auto-submitted: auto-generated
- References: <bug-81051-4@http.gcc.gnu.org/bugzilla/>
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;
}