1 // { dg-do run } 2 // Origin: Mark Mitchell <mark (at) codesourcery.com> 3 4 int i; 5 6 struct A 7 { 8 A () { i++; } 9 ~A () { i--; } 10 }; 11 12 struct B : public virtual A 13 { 14 B () { throw 1; } 15 }; 16 17 struct D: public B, virtual public A 18 { 19 }; 20 21 void f() 22 { 23 D d; 24 } 25 26 int main () 27 { 28 try { 29 f(); 30 } catch (int) { 31 } 32 33 return i; 34 } 35 36