libstdc++/42: vector<>::at() doesn't throw out_of_range
mikes@nilenet.com
mikes@nilenet.com
Wed Mar 15 14:47:00 GMT 2000
>Number: 42
>Category: libstdc++
>Synopsis: vector<>::at() doesn't throw out_of_range
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Mar 15 14:47:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: mikes@nilenet.com
>Release: 2.90.x
>Organization:
>Environment:
i686-linux slackware, gcc compiled with namespace
>Description:
if you give vector<>::at() an out of range value, it
doesn't throw out_of_range like it should
>How-To-Repeat:
try this simple program:
#include <iostream>
#include <vector>
#include <stdexcept>
int main()try
{
std::vector<int> myvec(2);
std::cout << myvec.at(2) << std::endl;
}
catch(std::out_of_range)
{
std::cerr << "out of range" << std::endl;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Libstdc++-prs
mailing list