repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Sync usage with man page.
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
eh
/
unexpected1.C
blob
e5982ffacc5cced8a8228fd0b48d97238098202b
1
// PR 3719
2
// Test that an unexpected handler can rethrow to categorize.
3
// { dg-do run }
4
5
#include <exception>
6
7
extern "C" void abort ();
8
9
struct One { };
10
struct Two { };
11
12
static void
13
handle_unexpected ()
14
{
15
try
16
{
17
throw;
18
}
19
catch (One &)
20
{
21
throw Two ();
22
}
23
}
24
25
static void
26
doit () throw (Two)
27
{
28
throw One ();
29
}
30
31
int main ()
32
{
33
std::set_unexpected (handle_unexpected);
34
35
try
36
{
37
doit ();
38
}
39
catch (Two &)
40
{
41
}
42
catch (...)
43
{
44
abort ();
45
}
46
}