ReactOS  0.4.15-dev-1397-g19779b3
rethrow5.cpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for
3 // full license information.
4 
5 #include <stdio.h>
6 int c, d;
7 struct A
8 {
9  int i;
10  A () { i = ++c; printf ("A() %d\n", i); }
11  A (const A&) { i = ++c; printf ("A(const A&) %d\n", i); }
12  ~A() { printf ("~A() %d\n", i); ++d; }
13 };
14 int
15 main ()
16 {
17  try
18  {
19  try
20  {
21  printf ("Throwing 1...\n");
22  throw A();
23  }
24  catch (A)
25  {
26  try
27  {
28  printf ("Throwing 2...\n");
29  throw;
30  }
31  catch (A)
32  {
33  printf ("Falling out...\n");
34  }
35  }
36  }
37  catch (A)
38  {
39  printf ("Caught.\n");
40  }
41  printf ("c == %d, d == %d\n", c, d);
42  return c != d;
43 }
int main()
Definition: rethrow5.cpp:15
A()
Definition: rethrow5.cpp:10
Definition: ehthrow.cxx:92
int d
Definition: rethrow5.cpp:6
A(const A &)
Definition: rethrow5.cpp:11
#define A(row, col)
int i
Definition: ehthrow.cxx:95
int c
Definition: rethrow5.cpp:6
const GLubyte * c
Definition: glext.h:8905
~A()
Definition: rethrow5.cpp:12
#define printf
Definition: config.h:203