1 /* PR middle-end/98266 - bogus array subscript is partly outside array
2 bounds on virtual inheritance
3 Same as Warray-bounds-19.C with nonvirtual inheritance.
5 { dg-options "-O2 -Wall" } */
7 void* operator new (__SIZE_TYPE__, void *p) { return p; }
8 void* operator new[] (__SIZE_TYPE__, void *p) { return p; }
20 // Exercise access to base members by ctor of the most derived class.
30 D1 () { B::ai = 0; C1::ai = 1; c1i = 2; };
35 void nowarn_derived_ctor_access_decl ()
41 void nowarn_derived_ctor_access_new ()
47 void nowarn_derived_ctor_access_placement_new ()
54 void nowarn_derived_ctor_access_new_array ()
60 void nowarn_derived_ctor_access_placement_new_array ()
62 char a[sizeof (D1) * 2];
63 D1 *p = new (a) D1[2];
68 // Exercise access to base members by ctor of the second most derived class.
73 ~C2 () { ai = 0; c2i = 1; }
81 void nowarn_base_dtor_access_decl ()
87 void nowarn_base_dtor_access_new ()
93 void nowarn_base_dtor_access_placement_new ()
100 void nowarn_base_dtor_access_new_array ()
106 void nowarn_base_dtor_access_placement_new_array ()
108 char a[sizeof (D2) * 2];
109 D2 *p = new (a) D2[2];