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: "tsyvarev at ispras dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2008 18:43:07 -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 #15 from tsyvarev at ispras dot ru 2008-11-01 18:43 -------
I belived that the easier describe situation is the better.
Because setting flag is simpler to observe, than the fact of comparision (in ==
end), PR was reported about flag but comparision.
But the second patch is also not correct...
If run test in the second attachment, in the second testcase(falsename -
"false", "truename" - true, input - "false") eofbit flag won't be set(it is
right). But in the third testcase(input is "true") implementation set eofbit
flag.
Problem is that __lim cannot be used as stopper for the cycle, because target
sequences have different lenght.
If move last if in for-cycle
if ((!__testt && __n >= __lc->_M_falsename_size)
|| (!__testf && __n >= __lc->_M_truename_size))
break;
to the beginning of the cycle, all seems to be correct... except case of
identical target sequences.
Later I'll try to write more presize test, and may try to write patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37958