repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
eh
/
filter2.C
blob
fe87cc9a30817efba61d3bb513d310e42df64e06
1
// Test that terminate gets run when a catch filter fails to match while
2
// running destructors. Original bug depended on a::~a being inlined.
3
// { dg-do run }
4
// { dg-options -O }
5
6
#include <exception>
7
#include <cstdlib>
8
9
struct e1 {};
10
struct e2 {};
11
12
struct a
13
{
14
a () { }
15
16
~a ()
17
{
18
try
19
{
20
throw e1();
21
}
22
catch (e2 &)
23
{
24
}
25
}
26
};
27
28
void
29
ex_test ()
30
{
31
a aa;
32
try
33
{
34
throw e1 ();
35
}
36
catch (e2 &)
37
{
38
}
39
}
40
41
void my_terminate ()
42
{
43
std::exit (0);
44
}
45
46
int
47
main ()
48
{
49
std::set_terminate (my_terminate);
50
51
try
52
{
53
ex_test ();
54
}
55
catch (...)
56
{
57
}
58
abort ();
59
}