[Bug libstdc++/37721] Segmentation fault
pinskia at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Oct 3 17:35:00 GMT 2008
------- Comment #20 from pinskia at gmail dot com 2008-10-03 17:34 -------
Subject: Re: Segmentation fault
Sent from my iPhone
On Oct 3, 2008, at 1:38 AM, "ivranos at freemail dot gr"
<gcc-bugzilla@gcc.gnu.org
> wrote:
>
>
> ------- Comment #9 from ivranos at freemail dot gr 2008-10-03 08:38
> -------
> I am sorry but you are not right/specific.
>
> At first there is no struct in the code, only class.
In C++ structs/classes are the same thing except if it is private or
public by defaut.
> Second, the copy
> constructor does not copy the passed argument, it ignores it.
And that is the bug really. Sort uses the copy construct to swap two
elements of the vector. So you will generate random data again and
again and the sort becomes confused.
Note std::sort uses std::swap which is defined this way.
Sorry but there is no bug in the library or GCC.
> But it
> initialises its data member the same way as the main constructor.
>
> So, there isn't any bug.
>
>
> --
>
> ivranos at freemail dot gr changed:
>
> What |Removed |Added
> ---
> ---
> ----------------------------------------------------------------------
> Status|RESOLVED |UNCONFIRMED
> Component|libstdc++ |c++
> Resolution|INVALID |
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37721
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37721
More information about the Gcc-bugs
mailing list