public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/22131] New: std::num_get fails for input with invalid groups
@ 2005-06-20 23:48 sebor at roguewave dot com
  2005-06-24  8:52 ` [Bug libstdc++/22131] " chris at bubblescope dot net
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sebor at roguewave dot com @ 2005-06-20 23:48 UTC (permalink / raw)
  To: gcc-bugs

The program below is expected to run successfully to completion but when
compiled with gcc 3.4.3 or 4.0.0 it aborts.

$ cat u.cpp && g++ u.cpp && ./a.out
#include <locale>
#include <sstream>
#include <cassert>

int main ()
{
    struct Punct: std::numpunct<char> {
        std::string do_grouping () const { return "\1"; }
        char do_thousands_sep () const { return '#'; }
    };

    std::istringstream strm ("00#0#1");
    strm.imbue (std::locale (strm.getloc (), (std::numpunct<char>*)new Punct));

    int x = 0;
    strm >> x;

    assert (1 == x);
    assert ((strm.eofbit | strm.failbit) == strm.rdstate ());
}
Assertion failed: 1 == x, file u.cpp, line 18
Abort (core dumped)

-- 
           Summary: std::num_get fails for input with invalid groups
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-29 12:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-20 23:48 [Bug libstdc++/22131] New: std::num_get fails for input with invalid groups sebor at roguewave dot com
2005-06-24  8:52 ` [Bug libstdc++/22131] " chris at bubblescope dot net
2005-06-24 12:18 ` pcarlini at suse dot de
2005-06-24 17:11 ` sebor at roguewave dot com
2005-06-24 18:22 ` pcarlini at suse dot de
2005-06-29 11:49 ` cvs-commit at gcc dot gnu dot org
2005-06-29 12:08 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).