[Bug libstdc++/54392] [4.6/4.7/4.8 Regression] std::string::assign() fails to update length

michael.haubenwallner at salomon dot at gcc-bugzilla@gcc.gnu.org
Thu Aug 30 07:33:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54392

--- Comment #14 from Michael Haubenwallner <michael.haubenwallner at salomon dot at> 2012-08-30 07:33:16 UTC ---
Indeed, the old buffer is freed before being copied.

Yep, this isn't a regression. In fact, with 4.4.3 it was the /empty string/
having the size of 1 in the comment#0 testcase, so bug#40518 actually improved
things here.

However, doesn't any operation with (const _CharT*, size_type) as input
parameter potentially have a problem with ( own.c_str(), own.size()+1 ) ?



More information about the Gcc-bugs mailing list