2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / return.C
blobaf9791c5769c2d95f3383387b10c907d53245899
1 // { dg-do run  }
2 // PRMS Id: 5331
3 // Bug: the return value of foo is constructed in a temporary and then
4 // copied into the return slot.  This is not necessary.
6 int c = 0;
8 struct X {
9    X(int i) { }
10    X(X const &XX) { c = 1; }
11    ~X() { }
14 const X foo() { 
15   return X(3); 
18 int main()
20   foo();
21   return c;