repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
init
/
for1.C
blob
02f8a2d48109ad7ecbf6466e7f65076f3732fcf7
1
// PR c++/13865
2
// Bug: We were destroying 'a' before executing the loop.
3
4
#include <stdio.h>
5
6
int i;
7
int r;
8
9
class A
10
{
11
public:
12
A() { printf("A ctor\n"); }
13
~A()
14
{
15
printf("A dtor\n");
16
if (i != 1)
17
r = 1;
18
}
19
};
20
21
int main(int argc, char **argv)
22
{
23
for (A a; i < 2; ++i) {
24
printf("iteration %d\n", i);
25
}
26
27
return r;
28
}