Debian Codegraph @

gcc/testsuite/g++.dg/eh/builtin5.C

raw
1 // PR c++/88482
2 // { dg-do compile }
3
4 extern "C" void __cxa_throw (void *, void *, void (*) (void *));
5 extern "C" void *__cxa_get_exception_ptr (void *) throw ();
6 extern "C" void *__cxa_begin_catch (void *) throw ();
7 extern "C" void __cxa_end_catch ();
8 extern "C" void __cxa_rethrow ();
9 extern "C" void *__cxa_allocate_exception (__SIZE_TYPE__) throw ();
10 extern "C" void __cxa_free_exception (void *) throw ();
11
12 struct S { S (); S (const S &); ~S (); };
13
14 int
15 foo (int x)
16 {
17 if (x > 27)
18 throw 19;
19 try
20 {
21 if (x > 15)
22 throw S ();
23 }
24 catch (S s)
25 {
26 throw;
27 }
28 return x + 3;
29 }