1 // PR middle-end/71387 2 // { dg-do compile } 3 // { dg-options "-Og" } 4 5 struct A 6 { 7 A (); 8 inline A (const A &); 9 }; 10 11 struct B 12 { BB13 explicit B (unsigned long) : b(0), c(1) {} 14 A a; 15 unsigned long b; 16 int c; 17 }; 18 19 struct C {}; 20 21 struct D 22 { DD23 explicit D (const C *) {} 24 }; 25 26 struct E : public D 27 { EE28 E (const C *x) : D(x) {} 29 virtual A foo () const = 0; 30 virtual A bar () const = 0; 31 }; 32 33 struct F : public B 34 { 35 inline void baz (); 36 F (const E *); 37 const E *f; 38 }; 39 40 inline void baz()41F::baz () 42 { 43 if (b == 0) 44 a = f->bar (); 45 else 46 a = f->foo (); 47 } 48 F(const E *)49F::F (const E *) : B(4) 50 { 51 baz (); 52 } 53