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/] [p4623.C] - Rev 307
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// prms-id: 4623
class base {
public:
int b_data;
base( int i=0 ) { b_data = i; }
void b_print() { }
};
class base1: virtual public base {
public:
int b1_data;
base1( int i = 0 ) { b1_data = i; b_data++; }
void b1_print() { }
};
class base2: virtual public base {
public:
int b2_data;
base2( int i = 0 ) { b2_data = i; b_data++; }
void b2_print() { }
};
class base3: public base {};
class derived: public base3, public base1, public base2 {
public:
int d_data;
derived( int i ) { d_data = i; ((base3 *)this)->b_data++; }
void d_print() { }
};
int main() {
derived d(1); d.d_print(); return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log