This is the mail archive of the gcc-prs@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]

Re: c++/9629: [3.2/3.3/3.4 regression] virtual inheritance segfault


Old Synopsis: virtual inheritance segfault
New Synopsis: [3.2/3.3/3.4 regression] virtual inheritance segfault

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Feb 14 20:46:18 2003
State-Changed-Why:
    Confirmed. Here's a very slightly reduced testcase:
    --------------------------
    struct A { };
    
    struct B {
    	B(A *) {}
    };
    
    struct C : virtual public A, public B {
    	C() : B(this) {}
    };
    
    struct D : virtual public C {};
    
    main() {
      new D();
    }
    ------------------------
    Executing this program segfaults with 3.2.2, 3.3, and 3.4.
    So it is a regression, assuming the code is legal.
    
    The problem is in casting this to A* in the constructor
    C::C. It's trying to cast to a virtual base, and it seems
    to me that this information is not available at the time
    we get to C::C, which then causes the segfault. But that's
    just a wild guess.
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9629


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