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/] [offset1.C] - Rev 414
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
extern "C" int printf(const char *, ...);
void *vp;
int fail = 0;
class Foo {
public:
virtual void setName() {
printf("Foo at %x\n", this);
if (vp != (void*)this)
fail = 1;
}
};
class Bar : public Foo {
public:
virtual void init(int argc, char **argv) {
printf("Bar's Foo at %x\n", (Foo*)this);
vp = (void*)(Foo*)this;
setName();
}
};
class Barf : virtual public Bar {
public:
virtual void init(int argc, char **argv) { Bar::init(argc, argv); }
};
class Baz : virtual public Bar, virtual public Barf {
public:
virtual void init(int argc, char **argv) { Barf::init(argc, argv); }
};
Bar *theBar = new Baz();
int main(int argc, char **argv) {
theBar->init(argc, argv);
return fail;
}
Go to most recent revision | Compare with Previous | Blame | View Log