This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
A new testcase for MI
- To: jason at cygnus dot com
- Subject: A new testcase for MI
- From: hjl at lucon dot org (H.J. Lu)
- Date: Thu, 28 May 1998 17:36:41 -0700 (PDT)
- Cc: egcs at cygnus dot com
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;
}