summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/goto1.C
blob: b0a0c5253b6406dba2e90b4ce50d61007f10926e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/14724
// { dg-do run }

int j;

template <class T>
struct C {
  C() { ++j; }
  ~C() { --j; }
};

int main(int, char **) {
  {
    int i = 0;
 again:
    C<int> v;
    if (++i < 10)
      goto again;
  }

  return j;
}