aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p7865.C
blob: d9a611889b1d694d02bb3103a1f972a4bc9c62fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// prms-id: 7865

int count;

struct A {
  A() { ++count; }
  ~A() { --count; }
};

int foo() { return 1; }

int bar()
{
  A a;
  for (;;) {
    A b;
    if (foo())
      return 0;
    if (foo())
      return 0;
  }
  return 0;
}

main() {
  bar();
  return count;
}