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