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
Fortran: fix passing of optional dummy as actual to optional argument [PR55978]
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.eh
/
fntry1.C
blob
9b14f011153231139f81017aded039ab4904457a
1
// { dg-do run }
2
// Bug: g++ fails to treat function-try-blocks in ctors specially.
3
// Submitted by Jason Merrill <jason@cygnus.com>
4
5
int c;
6
int r;
7
8
struct A {
9
int i;
10
A(int j) { i = j; }
11
~A() { c += i; }
12
};
13
14
struct B: public A {
15
A a;
16
B() try : A(1), a(2)
17
{ throw 1; }
18
catch (...)
19
{ if (c != 3) r |= 1; }
20
};
21
22
int main ()
23
{
24
try
25
{ B b; }
26
catch (...)
27
{ c = 0; }
28
29
if (c != 0) r |= 2;
30
31
return r;
32
}