1 // PR c++/411 2 3 // Test that a fully-constructed base is destroyed before transferring 4 // control to the handler of a function-try-block. 5 6 // { dg-do run } 7 8 int ad; 9 int r; 10 11 struct A { ~AA12 ~A() { ++ad; } 13 }; 14 15 struct B: public A { 16 ~B(); 17 }; 18 ~B()19B::~B () 20 try 21 { 22 throw 1; 23 } catch(...)24catch (...) 25 { 26 if (!ad) 27 r = 1; 28 return; 29 } 30 main()31int main () 32 { 33 { B b; } 34 return r; 35 } 36