Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.jason/return2.C

raw
1 // { dg-do run }
2 // PRMS Id: 5368
3 // Bug: the X temporary in foo() is not destroyed.
4
5 int c = 0;
6
7 struct X {
8 X (int) { c++; }
9 ~X() { c--; }
10 };
11
12 struct Y {
13 Y(const X &) { }
14 };
15
16 Y foo() {
17 return X(3);
18 }
19
20 int main()
21 {
22 foo();
23 return c;
24 }