Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.dg / init / for1.C
blob02f8a2d48109ad7ecbf6466e7f65076f3732fcf7
1 // PR c++/13865
2 // Bug: We were destroying 'a' before executing the loop.
4 #include <stdio.h>
6 int i;
7 int r;
9 class A
11 public:
12   A() { printf("A ctor\n"); }
13   ~A()
14   {
15     printf("A dtor\n");
16     if (i != 1)
17       r = 1;
18   }
21 int main(int argc, char **argv)
23   for (A a; i < 2; ++i) {
24     printf("iteration %d\n", i);
25   }
27   return r;