1 // PR c++/20206 2 // { dg-do run } 3 // { dg-options "-O0" } 4 5 void bar(int x)6bar (int x) 7 { 8 asm ("" : : "g" (x)); 9 } 10 SS11struct S { S () {}; virtual ~S () {}; }; fooT12struct T { virtual T *foo (int) {}; }; 13 struct V : virtual S, virtual T {}; 14 struct V v; 15 struct U : public S, public T 16 { 17 bool a; UU18 U () {} ~UU19 virtual ~U () {} fooU20 virtual V *foo (int x) 21 { 22 switch (x) 23 { 24 case 12: 25 break; 26 case 9: 27 bar (7); 28 break; 29 case 10: 30 bar (12); 31 break; 32 case 4: 33 bar (18); 34 break; 35 case 2: 36 bar (26); 37 break; 38 } 39 return &v; 40 } 41 }; 42 U u; 43 44 int main()45main () 46 { 47 } 48