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
Dead
[official-gcc.git]
/
gomp-20050608-branch
/
gcc
/
testsuite
/
g++.old-deja
/
g++.eh
/
cleanup1.C
blob
271ecf07873d15917643393e1bee01639857740b
1
// { dg-do run }
2
// Bug: obj gets destroyed twice because the fixups for the return are
3
// inside its cleanup region.
4
5
extern "C" int printf (const char *, ...);
6
7
int d;
8
9
struct myExc { };
10
11
struct myExcRaiser {
12
~myExcRaiser() { throw myExc(); }
13
};
14
15
struct stackObj {
16
~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); };
17
};
18
19
int test()
20
{
21
myExcRaiser rais;
22
stackObj obj;
23
return 0;
24
}
25
26
int main()
27
{
28
try {
29
test();
30
}
31
catch (myExc &) {
32
return d != 1;
33
}
34
return 1;
35
}