This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15793] Copy constructor doesn't work
- 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: 3 Jun 2004 17:24:21 -0000
- Subject: [Bug c++/15793] Copy constructor doesn't work
- References: <20040603101830.15793.brat.lukasz@wp.pl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-03 17:24 -------
Nope this is one of the cases where the C++ standard allows the compiler to an optimization of not
calling the copy construtor.
A b = a.makeA();
Basically what the compiling is doing (but note b is not initalized when the call to makeA is done):
A b;
a.makeA(&b);
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15793