public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sebor at roguewave dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/22131] New: std::num_get fails for input with invalid groups
Date: Mon, 20 Jun 2005 23:48:00 -0000	[thread overview]
Message-ID: <20050620234814.22131.sebor@roguewave.com> (raw)

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


             reply	other threads:[~2005-06-20 23:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20 23:48 sebor at roguewave dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050620234814.22131.sebor@roguewave.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).