This is the mail archive of the
mailing list for the GCC project.
[Bug c++/29378] The copy constructor is not being called upon return from function calls.
- 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 Oct 2006 16:55:45 -0000
- Subject: [Bug c++/29378] The copy constructor is not being called upon return from function calls.
- References: <firstname.lastname@example.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-10-07 16:55 -------
(In reply to comment #2)
> 2) The second reason is that if GCC ignores the programmer written copy
> constructors, then the program will be misbehaved, and the results
> unpredictable, with even the possibility of a crash. Optimizations are
> understandable only if they don't leave objects in unknown states.
Only one object is ever created and will ever be destoried here. So this is
not leaving the object in an unknown state because the state is well defined.