blob: 16646438ed247a9595b35b3a22d40b6fae7d9cab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// { dg-do run }
// Bug: obj gets destroyed twice because the fixups for the return are
// inside its cleanup region.
extern "C" int printf (const char *, ...);
int d;
struct myExc { };
struct myExcRaiser {
~myExcRaiser() { throw myExc(); }
};
struct stackObj {
~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); }
};
int test()
{
myExcRaiser rais;
stackObj obj;
return 0;
}
int main()
{
try {
test();
}
catch (myExc &) {
return d != 1;
}
return 1;
}
|