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++.dg/] [expr/] [cast4.C] - Rev 327
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// PR c++/22132
extern "C" void abort ();
struct foo {
int a;
int b;
};
class Foobar : public foo {
public:
Foobar() { a = 1; b = 2; }
virtual ~Foobar() {}
};
Foobar obj;
const Foobar* objPtr = &obj;
foo* f = (foo*)objPtr;
int main () {
if (f->a != 1 || f->b != 2)
abort ();
}
Go to most recent revision | Compare with Previous | Blame | View Log