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++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50618

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.3.5
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2011-10-04
     Ever Confirmed|0                           |1
            Summary|Virtual inheritance         |[4.4/4.5/4.6/4.7
                   |segfault                    |Regression] Virtual
                   |                            |inheritance segfault
   Target Milestone|---                         |4.4.7
      Known to fail|                            |4.4.1, 4.5.1, 4.6.1, 4.7.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-10-04 20:45:50 UTC ---
Here is a simplier testcase:
struct Base
{
    const int text;
    Base():text(1) {}
    Base(int aText)
    : text(aText) {}
};
struct SubA : public virtual Base
{
protected:
  int x;
public:
  SubA(int aX)
  : x(aX) {}
};
class SubB : public virtual Base
{};
struct Diamond : public SubA, public SubB
{
    Diamond(int text)
    : Base(text), SubA(5), SubB() {}

    void printText()
    {
        if(text != 2)
          __builtin_abort();
        if(x!=5)
          __builtin_abort();
    }
};

int main(int, char**)
{
    Diamond x(2);
    x.printText();
}


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