From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18780 invoked by alias); 11 Oct 2002 11:16:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 18633 invoked by uid 71); 11 Oct 2002 11:16:01 -0000 Resent-Date: 11 Oct 2002 11:16:01 -0000 Resent-Message-ID: <20021011111601.18632.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, johnb@stl.sarov.ru Received: (qmail 32054 invoked by uid 61); 11 Oct 2002 11:11:07 -0000 Message-Id: <20021011111107.32050.qmail@sources.redhat.com> Date: Fri, 11 Oct 2002 04:16:00 -0000 From: johnb@stl.sarov.ru Reply-To: johnb@stl.sarov.ru To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/8195: n-th algorithm (STL) doesn`t work properly X-SW-Source: 2002-10/txt/msg00454.txt.bz2 List-Id: >Number: 8195 >Category: libstdc++ >Synopsis: n-th algorithm (STL) doesn`t work properly >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Oct 11 04:16:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: johnb@stl.sarov.ru (Eugeny Belov) >Release: g++ v3.2 >Organization: >Environment: Red Hat Linux release 8.0 >Description: The simple testcase using nth_element() doesn`t work properly. Compiled by g++ (v.3.2, 3.1, 2.96) it gives the "4 4 5 6 6 6 9 12 8 10", but expected output is "4 4 5 6 6 6 8 9 10 12" (sorted sequence). See the testcase. >How-To-Repeat: Compile the testcase by g++ and run it, compare output. The correct result is the sorted integers sequence. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="nth-elem.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="nth-elem.cpp" I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8aXRlcmF0 b3I+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7ICAKICAgaW50IGFbMTBdID0g ezQsIDEyLCA5LCA1LCA2LCA2LCA2LCA0LCA4LCAxMH07CiAgIAogICAgbnRoX2VsZW1lbnQoYSwg YSsyLCBhKzEwKTsKICAgIGNvcHkoYSwgYSsxMCwgb3N0cmVhbV9pdGVyYXRvcjxpbnQ+KGNvdXQs ICIgIikpOwogICAgY291dCA8PCBlbmRsOwoKICAgcmV0dXJuIDA7Cn0K