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
Merge -r 127928:132243 from trunk
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
eh
/
init-temp1.C
blob
29eae6972d63629e17dd79fb76e220088df3a911
1
// PR c++/15764
2
3
extern "C" void abort ();
4
5
int counter = 0;
6
int thrown;
7
struct a {
8
~a () { if (thrown++ == 0) throw 42; }
9
};
10
11
int f (a const&) { return 1; }
12
int f (a const&, a const&) { return 1; }
13
14
struct b {
15
b (...) { ++counter; }
16
~b () { --counter; }
17
};
18
19
bool p;
20
void g()
21
{
22
if (p) throw 42;
23
}
24
25
int main () {
26
thrown = 0;
27
try {
28
b tmp(f (a(), a()));
29
30
g();
31
}
32
catch (...) {}
33
34
thrown = 0;
35
try {
36
b tmp(f (a()));
37
38
g();
39
}
40
catch (...) {}
41
42
if (counter != 0)
43
abort ();
44
}