This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/13864] stl_hastable.h Line 527
- From: "greg dot bertin at solacesystems dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2004 14:28:11 -0000
- Subject: [Bug libstdc++/13864] stl_hastable.h Line 527
- References: <20040126054235.13864.greg.bertin@solacesystems.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From greg dot bertin at solacesystems dot com 2004-01-26 14:28 -------
Subject: RE: stl_hastable.h Line 527
Actually this is my idiocy ... you are quite correct. Copy constructors
must assume they are working with uninitialized memory ... my fault ...
sorry!!
> -----Original Message-----
> From: gdr at integrable-solutions dot net [mailto:gcc-
> bugzilla@gcc.gnu.org]
> Sent: Monday, January 26, 2004 1:39 AM
> To: greg.bertin@solacesystems.com
> Subject: [Bug libstdc++/13864] stl_hastable.h Line 527
>
>
> ------- Additional Comments From gdr at integrable-solutions dot net
> 2004-01-26 06:38 -------
> Subject: Re: New: stl_hastable.h Line 527
>
> "greg dot bertin at solacesystems dot com" <gcc-bugzilla@gcc.gnu.org>
> writes:
>
> | _Construct(&__n->_M_val, __obj); being called with an unitialized
memory
> | pointer (__n) being passed as the first parameter (i.e. it is memory
> allocated
> | from an allocator in line 524). Memory should be default constructed
> first to
> | ensure the class' copy constructor behaves properly:
> |
> | try {
> | _Construct(&__n->_M_val);
> | _Construct(&__n->_M_val, __obj);
> | return __n;
> | }
>
> I don't understand. Why should a default construction be needed
> before a copy-construction? A constructor is called only once in an
> object lifetime.
>
> -- Gaby
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13864
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13864