URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [p4246.C] - Rev 414
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// prms-id: 4246
extern "C" void abort ();
int num_d;
class A
{
public:
A() { }
virtual ~A() { }
virtual void id() { }
};
class B
{
public:
B() { }
virtual ~B() { }
virtual void id() { }
};
class C : public A, public B
{
public:
C() { }
virtual ~C() { }
void id() { abort(); }
};
class D : public C
{
public:
D() { ++num_d; }
virtual ~D() { -- num_d; }
void id() { }
};
int main()
{
D* dp2 = new D;
((B*)dp2)->id();
delete (B*) dp2;
B* bp1 = new D;
bp1->id();
delete bp1;
return num_d != 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log