From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3141 invoked by alias); 30 Oct 2008 14:23:34 -0000 Received: (qmail 7173 invoked by uid 48); 30 Oct 2008 14:21:15 -0000 Date: Thu, 30 Oct 2008 14:23:00 -0000 Subject: [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 X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tsyvarev at ispras dot ru" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01976.txt.bz2 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