| 1 |
/* { dg-do assemble } */ |
| 2 |
/* Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'. */ |
| 3 |
|
| 4 |
class A {}; |
| 5 |
class B {}; |
| 6 |
|
| 7 |
static void *func (int n) |
| 8 |
{ |
| 9 |
void *p; |
| 10 |
if (p == 0) throw ::A (); |
| 11 |
} // { dg-warning "control reaches end of non-void function" } |
| 12 |
|
| 13 |
static void *func (int n, B const &) |
| 14 |
{ |
| 15 |
try { |
| 16 |
return func (n); |
| 17 |
} |
| 18 |
catch (::A const &) { |
| 19 |
} |
| 20 |
return func (n); |
| 21 |
} |
| 22 |
|
| 23 |
void *f1 (int n) |
| 24 |
{ |
| 25 |
return func (n, B()); |
| 26 |
} |
| 27 |
|
| 28 |
void *f2 (int n) |
| 29 |
{ |
| 30 |
return func (n, B()); |
| 31 |
} |