From mboxrd@z Thu Jan 1 00:00:00 1970 From: brendan@zen.org To: gcc-gnats@gcc.gnu.org Subject: libstdc++/4534: vector::_M_range_check should throw out_of_range Date: Thu, 11 Oct 2001 05:26:00 -0000 Message-id: <20011011122356.695.qmail@sourceware.cygnus.com> X-SW-Source: 2001-10/msg00215.html List-Id: >Number: 4534 >Category: libstdc++ >Synopsis: vector::_M_range_check should throw out_of_range >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Oct 11 05:26:25 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Brendan Kehoe >Release: CVS tree >Organization: >Environment: >Description: Section 23.1.1.13 of the standard says the member function at() of sequences should throw out_of_range if n >= a.size(), not range_error as is currently thrown in bits/stl_bvector.h's _M_range_check method. >How-To-Repeat: >Fix: Attached patch changes it to use __throw_out_of_range instead of __throw_range_error. This makes it also match what's implemented in stl_vector.h for the generic vector template's _M_range_check method. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="diffs-bvector.txt" Content-Disposition: inline; filename="diffs-bvector.txt" 2001-10-09 Brendan Kehoe * stl_bvector.h (vector::_M_range_check): Fix to throw out_of_range, not range_error, thus sayeth $23.1.1.13. Index: include/bits/stl_bvector.h =================================================================== RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/stl_bvector.h,v retrieving revision 1.5 diff -u -p -r1.5 stl_bvector.h --- stl_bvector.h 2001/06/27 17:09:52 1.5 +++ stl_bvector.h 2001/10/10 11:44:31 @@ -485,7 +485,7 @@ template void _M_range_check(size_type __n) const { if (__n >= this->size()) - __throw_range_error("vector"); + __throw_out_of_range("vector"); } reference at(size_type __n)