Bug 8096 - deque::at() throws std::range_error instead of std::out_of_range
Summary: deque::at() throws std::range_error instead of std::out_of_range
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Phil Edwards
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-30 07:36 UTC by johnb
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test232.cpp (324 bytes, application/octet-stream)
2003-05-21 15:17 UTC, johnb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description johnb 2002-09-30 07:36:01 UTC
According to C++ ISO/IEC 14882 Standard , see 23.1.1.13, the deque::at() should throw out_of_range exception if there is a bounds violation. Instead of out_of_range it throws range_error exception. See the testcase.

Release:
gcc v3.2

Environment:
Red Hat 8.0 beta (7.3.94)

How-To-Repeat:
Compile testcase with g++ 3.2 and run it, You`ll see the Failed message.
Comment 1 Paolo Carlini 2002-09-30 11:53:39 UTC
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-Why: Analyzed.
Comment 2 Paolo Carlini 2002-09-30 11:53:39 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Already fixed for 3.3, still present in the 3_2-branch:
    this is not a regression, therefore probably will not be
    fixed in the branch.
    Thanks for your report, Paolo.
Comment 3 Paolo Carlini 2002-10-01 13:52:55 UTC
Responsible-Changed-From-To: paolo->pme
Responsible-Changed-Why: Phil is going to fix it for 3.2.1 too.
Comment 4 Phil Edwards 2002-10-01 18:00:03 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed thusly:
    
        http://gcc.gnu.org/ml/libstdc++/2002-10/msg00002.html
Comment 5 Phil Edwards 2002-10-02 00:58:53 UTC
From: pme@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: libstdc++/8096
Date: 2 Oct 2002 00:58:53 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	pme@gcc.gnu.org	2002-10-01 17:58:53
 
 Modified files:
 	libstdc++-v3   : ChangeLog 
 	libstdc++-v3/include/bits: stl_deque.h 
 
 Log message:
 	2002-10-01  Phil Edwards  <pme@gcc.gnu.org>
 	
 	PR libstdc++/8096
 	* include/bits/stl_deque.h (deque::_M_range_check):  Throw
 	out_of_range, not range_error.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1057.2.159.2.29&r2=1.1057.2.159.2.30
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_deque.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.17.8.2.4.1&r2=1.17.8.2.4.2