1 struct base 2 { 3 enum mode : short { in, out, top, bottom }; 4 enum state { pass, fail, unknown }; 5 typedef long int_type; 6 }; 7 8 struct A : public base 9 { 10 int_type _M_i; 11 int_type _M_n; 12 mode _M_type; 13 }; 14 15 struct C1 : public base 16 { 17 mode _M_type; 18 }; 19 20 struct C2 : virtual public base 21 { 22 mode _M_type; 23 }; 24 25 struct C3 : public base 26 { 27 mode _M_type; 28 ~C3C329 virtual ~C3() { }; 30 }; 31 32 struct C4 : public base 33 { 34 mode _M_type; 35 36 virtual void foo() = 0; 37 }; 38 39 struct D1 : public A 40 { 41 int_type _M_index; 42 int_type* _M_array; 43 bool _M_ok; 44 }; 45 46 struct D2 : public C1 47 { 48 state _M_state; 49 int_type _M_index; 50 int_type* _M_array; 51 bool _M_ok; 52 }; 53 54 struct D3 : public C1 55 { 56 int_type _M_index; 57 int_type* _M_array; 58 }; 59 60 struct D2v : virtual public C2 61 { 62 state _M_state; 63 int_type _M_index; 64 int_type* _M_array; 65 bool _M_ok; 66 }; 67 68 struct D3v : virtual public C3 69 { 70 int_type _M_index; 71 int_type* _M_array; 72 }; 73 74 struct D4v : public C4 75 { 76 int_type _M_index; 77 int_type* _M_array; 78 fooD4v79 void foo() { } 80 }; 81 main()82int main() 83 { 84 D1 obj1; 85 D2 obj2; 86 D3 obj3; 87 D2v obj2v; 88 D3v obj3v; 89 D4v obj4v; 90 return 0; 91 } 92