1 // PR c++/13944
2 
3 // Verify that we still call terminate() if we do run the copy constructor,
4 // and it throws.
5 
6 // { dg-do run }
7 
8 #include <cstdlib>
9 #include <exception>
10 
11 struct A
12 {
AA13   A() { }
AA14   A(const A&) { throw 1; }
15 };
16 
17 A a;
18 
19 void
good_terminate()20 good_terminate() { std::exit (0); }
21 
main()22 int main()
23 {
24   std::set_terminate (good_terminate);
25   try
26     {
27       throw a;
28     }
29   catch (...)
30     {
31       return 2;
32     }
33   return 3;
34 }
35