This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: g++ compiler generated copy constructor
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: navin p <navinp1281 at gmail dot com>
- Cc: Oleg Endo <oleg dot endo at t-online dot de>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 12 Aug 2014 10:44:13 +0100
- Subject: Re: g++ compiler generated copy constructor
- Authentication-results: sourceware.org; auth=none
- References: <CAKVd3pWt2XddzPmK749SxeE4zEt0f-U5m13yNfyUG7+Nbd4phQ at mail dot gmail dot com> <1407784512 dot 16524 dot 62 dot camel at yam-132-YW-E178-FTW> <CAKVd3pWxp-g+kuRu9McfS+WqDaBokQMGBVeZ0DOHQsFZ=4SwsA at mail dot gmail dot com>
On 11 August 2014 23:41, navin p wrote:
> Hi,
> I'm maintaining an old C++ library code (written in around 2002) ,
> I get segfaults in constructor. The default constructors are generated
> by the compiler. When i compile the program with
> fno-elide-constructors it works without any problem ie it runs fine. I
> want to see what is happening with the constructor and why it is
> segfaulting. It is probably the RVO kicking in and changing the
> reference counting the library implements.
What an implicitly-defined constructor does is entirely mechanical,
you shouldn't need to read it to know what it does.