Debian Codegraph @

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

raw
1 // PR c++/88482
2 // { dg-do compile }
3 // Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.
4
5 float __cxa_throw; // { dg-message "previous declaration" }
6 extern "C" void *__cxa_get_exception_ptr (void *);
7 float __cxa_begin_catch; // { dg-message "previous declaration" }
8 float __cxa_end_catch; // { dg-message "previous declaration" }
9 float __cxa_rethrow; // { dg-message "previous declaration" }
10 float __cxa_allocate_exception; // { dg-message "previous declaration" }
11 extern "C" void __cxa_free_exception (void *);
12
13 struct S { S (); S (const S &); ~S (); };
14
15 int
16 foo (int x)
17 {
18 if (x > 27)
19 throw 19; // { dg-error "redeclared" }
20 try
21 {
22 if (x > 15)
23 throw S ();
24 }
25 catch (S s) // { dg-error "redeclared" }
26 {
27 throw; // { dg-error "redeclared" }
28 }
29 return x + 3;
30 }