This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19317] [4.0 Regression] forgets to deep-copy temporary return value
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jan 2005 19:26:29 -0000
- Subject: [Bug c++/19317] [4.0 Regression] forgets to deep-copy temporary return value
- References: <20050107191510.19317.mueller@kde.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-07 19:26 -------
Hmm,
a = b (&a, &D.1613);
I think the problem is that we cannot remove the tempory return value for this testcase.
Here is another testcase which is related testcase:
extern "C" void abort( void );
struct A
{
A() { d = d2 = 0; width = -1; }
A( int _w ) : d( 0 ), d2( 0 ), width( _w ) {}
A b( ) const;
int d;
int d2;
int width;
};
A A::b( ) const
{
A tmp;
tmp.width = 10+this->width;
return tmp;
}
int main()
{
A a( 100 );
a = a.b();
if ( a.width != 110 )
abort();
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |4.0.0
Known to work| |3.4.0
Last reconfirmed|0000-00-00 00:00:00 |2005-01-07 19:26:28
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19317