1 // PR c++/13944 2 3 // Verify that we don't call terminate() if initializing the exception 4 // object throws. 5 6 // { dg-do run } 7 8 struct A 9 { AA10 A() { } AA11 A(const A&) { throw 1; } 12 }; 13 14 A a; 15 main()16int main() 17 { 18 try 19 { 20 throw a; 21 } 22 catch (int) 23 { 24 return 0; 25 } 26 catch (A&) 27 { 28 return 2; 29 } 30 return 3; 31 } 32