1 // Red Hat bugzilla 64535 2 // Bug: We are allocationg stuff into the tail padding of POD class "A". 3 // { dg-do run } 4 5 struct A 6 { 7 int x; 8 char y; 9 }; 10 11 struct B : public A { fB12 virtual void f () {} 13 char z; 14 }; 15 16 A a = { 21, 42 }; 17 B b; 18 19 int main(void)20main (void) 21 { 22 b.x = 12; 23 b.y = 24; 24 b.z = 36; 25 26 A *ap = &b; 27 28 *ap = a; 29 30 return (b.z != 36); 31 } 32