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 {
XX8   X (int) { c++; }
~XX9   ~X() { c--; }
10 };
11 
12 struct Y {
YY13    Y(const X &) { }
14 };
15 
foo()16 Y foo() {
17   return X(3);
18 }
19 
main()20 int main()
21 {
22   foo();
23   return c;
24 }
25