summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p7865.C
blob: 8727e1554ff44a71eaeb016bef242d2c5e2e372b (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
29
// { dg-do run  }
// 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;
}

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