libstdc++/2830: incorrect inserter for std::string

Phil Edwards pedwards@disaster.jaj.com
Tue May 15 12:36:00 GMT 2001


The following reply was made to PR libstdc++/2830; it has been noted by GNATS.

From: Phil Edwards <pedwards@disaster.jaj.com>
To: kenny.simpson@gs.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/2830: incorrect inserter for std::string
Date: Tue, 15 May 2001 14:09:39 -0400

 On Tue, May 15, 2001 at 07:07:27PM -0000, kenny.simpson@gs.com wrote:
 > At the end of bits/ostream.tcc I see:
 > 
 > // 21.3.7.8 basic_string::operator<<
 > ...
 >     { return (__out << __s.c_str()); }
 > 
 > first, shouldn't this be 21.3.7.9? as 21.3.7.8 describes swap.
 
 Yes, good catch.
 
 > second, this won't handle '\0's properly.
 
 Do you have a small testcase?
 
 
 Phil
 
 -- 
 pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
 devphil at several other less interesting addresses in various dot domains
 The gods do not protect fools.  Fools are protected by more capable fools.



More information about the Gcc-prs mailing list