repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
FSF GCC merge 02/23/03
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
return2.C
blob
29da5b28e5873f1fd7f12dffd1e096d63e1a2765
1
// PRMS Id: 5368
2
// Bug: the X temporary in foo() is not destroyed.
3
4
int c = 0;
5
6
struct X {
7
X (int) { c++; }
8
~X() { c--; }
9
};
10
11
struct Y {
12
Y(const X &) { }
13
};
14
15
Y foo() {
16
return X(3);
17
}
18
19
int main()
20
{
21
foo();
22
return c;
23
}