2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / elide2.C
blob7d65d9ee6abc664faa4de4144383533138bb03c1
1 // PR c++/13944
3 // Verify that we don't call terminate() if initializing the exception
4 // object throws.
6 // { dg-do run }
8 struct A
10   A() { }
11   A(const A&) { throw 1; }
14 A a;
16 int main()
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;