| 1 |
// { dg-do assemble } |
| 2 |
// { dg-options "-fexceptions" } |
| 3 |
// GROUPS passed exceptions |
| 4 |
// except file |
| 5 |
// Message-Id: <[email protected]> |
| 6 |
// From: [email protected] |
| 7 |
// Subject: Bugs |
| 8 |
// Date: Wed, 22 Jul 92 08:29:30 EDT |
| 9 |
|
| 10 |
extern "C" int puts(const char *); |
| 11 |
|
| 12 |
class foo { |
| 13 |
public: |
| 14 |
class error {}; |
| 15 |
|
| 16 |
void cause_error(void) { throw error(); } |
| 17 |
}; |
| 18 |
|
| 19 |
int main(void) |
| 20 |
{ |
| 21 |
foo f; |
| 22 |
try { |
| 23 |
f.cause_error(); |
| 24 |
} |
| 25 |
catch (foo::error) { |
| 26 |
puts("Caught it."); |
| 27 |
} |
| 28 |
return 0; |
| 29 |
} |