This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/37958] num_get<>::do_get(bool) sets eofbit flag incorrectly when boolalpha == true
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Oct 2008 16:07:00 -0000
- Subject: [Bug libstdc++/37958] num_get<>::do_get(bool) sets eofbit flag incorrectly when boolalpha == true
- References: <bug-37958-16694@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from paolo dot carlini at oracle dot com 2008-10-30 16:07 -------
(In reply to comment #0)
> It seems that implementation always set str.eofbit when after call of the
> function (in == end).
>
> But standard states(22.2.2.1.2, p16) that this flag should be set only when:
> "if, when seeking another character to match, it is found that (in == end)" (on
> success)
> or "if the reason for the failure was that (in == end)" (on fail)
>
> This conditions are not the same as simply (in == end).
Frankly, I don't get it. In my reading of the standard, either when val is set
or val is not set, when in == end at the end then we have eofbit. Maybe you
should simply attach a testcase where the behavior is incorrect, the provided
one is fine (and consistent with the general behavior for numeric parsing).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37958