stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Closed: (STDCXX-294) std::vector(iterator, size_type, value_type) corrupts data
Date Tue, 22 Apr 2008 03:43:21 GMT

     [ https://issues.apache.org/jira/browse/STDCXX-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Sebor closed STDCXX-294.
-------------------------------


Regression test committed in [r650370|http://svn.apache.org/viewvc?rev=650370&view=rev].

> std::vector(iterator, size_type, value_type) corrupts data
> ----------------------------------------------------------
>
>                 Key: STDCXX-294
>                 URL: https://issues.apache.org/jira/browse/STDCXX-294
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 23. Containers
>    Affects Versions: 4.1.2, 4.1.3
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>            Priority: Critical
>             Fix For: 4.2.0
>
>
> The program below aborts at runtime:
> $ cat t.cpp && make t && ./t
> #include <assert.h>
> #include <vector>
> int main()
> {
>     static const int a[] = { 1, 2, 3, 4, 5 };
>     std::vector<int> v (a, a + sizeof a / sizeof *a);
>     v.insert (v.begin () + 2, 2, -1);
>     static const int b[] = { 1, 2, -1, -1, 3, 4, 5 };
>     assert (v == std::vector<int>(b, b + sizeof b / sizeof *b));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include
-I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include  -pedantic
-nostdinc++ -g  -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long  t.cpp
> gcc t.o -o t  -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s  -lsupc++ -lm
> Assertion failed: v == std::vector<int>(b, b + sizeof b / sizeof *b), file t.cpp,
line 12
> Abort (core dumped)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message