From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16470 invoked by alias); 17 Apr 2009 22:26:47 -0000 Received: (qmail 16448 invoked by uid 48); 17 Apr 2009 22:26:34 -0000 Date: Fri, 17 Apr 2009 22:26:00 -0000 Subject: [Bug libstdc++/39802] New: std::num_get fails to pase negative zero input correctly X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ritter at roguewave dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-04/txt/msg01507.txt.bz2 A call to std::num_get fails to parse negative values (specifically -0 in my example). /** Begin Test **/ #include #include #include int main () { unsigned long val = 1; std::stringbuf sb ("-0"); std::istream is (&sb); std::ios_base::iostate err (std::ios_base::goodbit); typedef std::istreambuf_iterator iter_t; const std::num_get& fac = std::use_facet >(is.getloc ()); fac.get (is, iter_t (), is, err, val); assert (is.eofbit == err && 0 == val); return 0; } /** End Test **/ Even thought this test case only exercises -0 I think the method should be able to handle any negative value. I have noted that other implementations do not appear to exhibit this behavior. -- Summary: std::num_get fails to pase negative zero input correctly Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ritter at roguewave dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39802