FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.eh / fntry1.C
blob9c1c0ff0a791301b790a9ab83c047b2705fd8b93
1 // Bug: g++ fails to treat function-try-blocks in ctors specially.
2 // Submitted by Jason Merrill <jason@cygnus.com>
4 int c;
5 int r;
7 struct A {
8   int i;
9   A(int j) { i = j; }
10   ~A() { c += i; }
13 struct B: public A {
14   A a;
15   B() try : A(1), a(2)
16     { throw 1; }
17   catch (...)
18     { if (c != 3) r |= 1; }
21 int main ()
23   try
24     { B b; }
25   catch (...)
26     { c = 0; }
28   if (c != 0) r |= 2;
30   return r;