This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/37958] num_get<>::do_get(bool) sets eofbit flag incorrectly when boolalpha == true



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]