public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/37957]  New: Wrong behaviour of num_get<>::do_get(bool) in the case when one target sequence is a prefix of the other one
@ 2008-10-30 14:23 tsyvarev at ispras dot ru
  2008-10-30 14:25 ` [Bug libstdc++/37957] " tsyvarev at ispras dot ru
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tsyvarev at ispras dot ru @ 2008-10-30 14:23 UTC (permalink / raw)
  To: gcc-bugs

There are some examples in the description of member function of the num_get<>
facet

iter_type do_get(iter_type in, iter_type end, ios_base& str, ios_base::iostate&
err, bool& val) const

for the case when (str.flags() & ios_base::boolalpha) != 0, that clarify the
algorithm that the function implements (22.2.2.1.2, p16):

For targets true: "a" and false: "abb", the input sequence "a" yields val ==
true and err == str.eofbit; the input sequence "abc" yields err = str.failbit,
with in ending at the 'c'. 

In the last example, however, the attached test program shows the following:

andrew@Ubuntu:/mnt/hgfs/shared/temp/test$ g++ test.cpp && ./a.out
failbit wasn't set, and result is true
Rest of stream is 'bc'.

It seems (from this and other tests), that the implementation stops reading
from 'in' when it founds a sequence that matches one of the target sequences.
But it should test, whether the sequence is a (proper) prefix of another target
sequence. And if it is, the function should continue reading.

This behaviour doesn't follow obviously from the description of the function,
but it follows from the examples.

The detailed bug description can be found at: 

http://linuxtesting.org/results/report?num=S0736


-- 
           Summary: Wrong behaviour of num_get<>::do_get(bool) in the case
                    when one target sequence is a prefix of the other one
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tsyvarev at ispras dot ru


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


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

end of thread, other threads:[~2008-11-11 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-30 14:23 [Bug libstdc++/37957] New: Wrong behaviour of num_get<>::do_get(bool) in the case when one target sequence is a prefix of the other one tsyvarev at ispras dot ru
2008-10-30 14:25 ` [Bug libstdc++/37957] " tsyvarev at ispras dot ru
2008-11-11 10:24 ` tsyvarev at ispras dot ru
2008-11-11 12:10 ` paolo dot carlini at oracle dot com

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