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
* g++.dg/eh/new1.C: XFAIL on AIX.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
eh
/
cond4.C
blob
4d312e478d44294eef6a59d15b7a968f1ca38fff
1
// Runtime version of cond3.C. We call terminate when the A cleanup throws
2
// because we've already initialized the exception object.
3
// { dg-do run }
4
5
#include <exception>
6
#include <cstdlib>
7
8
void my_terminate ()
9
{
10
std::exit (0);
11
}
12
13
struct A {
14
A(int) { }
15
~A() throw(int) { throw 1; };
16
};
17
struct B {
18
B(A) { }
19
~B() { }
20
};
21
bool b;
22
23
int main()
24
{
25
std::set_terminate (my_terminate);
26
try
27
{
28
throw b ? B(1) : B(1);
29
}
30
catch (...) { }
31
return 1;
32
}