FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.dg / eh / ctor1.C
blob43b735f0b00a5fb79c7a4a8ca82475f45128f9a6
1 // { dg-do run }
3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 26 Dec 2001 <nathan@nathan@codesourcery.com>
6 // PR 411
8 bool was_f_in_Bar_destroyed=false;
10 struct Foo
12   ~Foo()
13   {
14     was_f_in_Bar_destroyed=true;
15   }
18 struct Bar
20   ~Bar()
21   {
22     throw 1;
23   }
24   
25   Foo f;
28 int main()
30   try
31     {
32       Bar f; 
33     }
34   catch(int i)
35     {
36       if(was_f_in_Bar_destroyed)
37         {
38           return 0;
39         }
40     }
41   return 1;