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

A new testcase for MI


Hi,

I think MI in g++ doesn't work very well. Basically g++ is confused
by the location of the vtable.

# gcc bar.cc
# a.out
zsh: 8587 segmentation fault  ./a.out
# gcc -DFOO bar.cc
# a.out


-- 
H.J. Lu (hjl@gnu.org)
--bar.cc---- 
class S0
{
public:
  S0() { };

  virtual void set () {}
  virtual ~S0() { }
};



struct S
{
  S() { };
};
#ifdef FOO
class S1 : public S0, public S
#else
class S1 : public S, public S0
#endif
{ 
public:
  S1() { }
};


void test_ptr(void *ctxt)
{
  S0 *ctxt1 = static_cast<S0*>(ctxt);
  ctxt1->set ();
}


int main()
{
  S1 *ctxt = new S1();

  test_ptr(ctxt);

  return 0;
}


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