1 // { dg-do assemble  }
2 // { dg-options "-fexceptions" }
3 // GROUPS passed exceptions
4 // except file
5 // From: GUSTAVO%DRAGON@orion.cpqd.ansp.br
6 // Date:     15 Dec 1993 09:33:30 +0000 (C)
7 // Subject:  exception handling problem
8 // Message-ID: <01H6I5GEAF5UPBJ0UV@VENUS.CPQD.ANSP.BR>
9 
10 struct Exception
11  {
12      int v;
ExceptionException13      Exception(int i) { v = i; };
14  };
15 
inc(int & i)16 void inc(int &i)
17  {
18      try {
19          if (i == 0)
20              throw Exception(i);
21          else
22              i++;
23      }
24      catch (Exception v) {
25          i = v.v;
26      }
27  }
28