You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2006/12/16 00:08:21 UTC

[jira] Commented: (STDCXX-309) std::valarray::operator[](std::gslice) bad result

    [ http://issues.apache.org/jira/browse/STDCXX-309?page=comments#action_12458966 ] 
            
Martin Sebor commented on STDCXX-309:
-------------------------------------

The change isn't quite correct. The slightly modified original test case below still fails:

$ cat z.cpp && gmake z && ./z
#include <cassert>
#include <cstddef>
#include <valarray>

int main ()
{
    const int a[] = { 1, 2, 3, 4, 5, 6 };

    const std::valarray<int> v (a, sizeof a / sizeof *a);

    const std::size_t start = 5;
    std::valarray<std::size_t> length (1, 1);
    std::valarray<std::size_t> stride (1, 1);

    const std::gslice gsl (start, length, stride);

    for (int i = 0; i != 2; ++i) {
        const std::valarray<int> vsl = v [gsl];
        assert (a [start] == vsl [0]);
    }
} 
CC -c -D_RWSTDDEBUG   -mt -D_RWSTD_USE_CONFIG -I/nfs/devco/sebor/dev/stdlib/include -I/build/sebor/sunpro-5.8.j1-15S/include -I/nfs/devco/sebor/dev/stdlib/examples/include  -library=%none -g  -xarch=v9 +w   z.cpp
CC z.o -o z -library=%none -L/build/sebor/sunpro-5.8.j1-15S/lib  -mt  -xarch=v9 -L/build/sebor/sunpro-5.8.j1-15S/lib -lstd15S   -lm 
Assertion failed: a [start] == vsl [0], file z.cpp, line 19
Abort (core dumped)


> std::valarray::operator[](std::gslice) bad result
> -------------------------------------------------
>
>                 Key: STDCXX-309
>                 URL: http://issues.apache.org/jira/browse/STDCXX-309
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3
>         Environment: all
>            Reporter: Martin Sebor
>         Assigned To: Martin Sebor
>             Fix For: 4.2
>
>
> The program below aborts at runtime with the latest trunk:
> $ cat t.cpp && nice gmake t && ./t
> #include <cassert>
> #include <cstddef>
> #include <valarray>
> int main ()
> {
>     const int a[] = { 1, 2, 3, 4, 5, 6 };
>     const std::valarray<int> v (a, sizeof a / sizeof *a);
>     const std::size_t          start = 5;
>     std::valarray<std::size_t> length (1, 1);
>     std::valarray<std::size_t> stride (1, 1);
>     const std::gslice gsl (start, length, stride);
>     const std::valarray<int> vsl = v [gsl];
>     assert (a [start] == vsl [0]);
> }
> aCC -c -I/nfs/devco/sebor/dev/stdlib/include/ansi -I/usr/include  -D_RWSTDDEBUG   -mt -D_RWSTD_USE_CONFIG -I/nfs/devco/sebor/dev/stdlib/include -I/build/sebor/aCC-3.70-15S/include -I/nfs/devco/sebor/dev/stdlib/examples/include  -Aa +nostl  -g +d  +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849   t.cpp
> aCC t.o -o t -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings   -mt +DD64 -L/build/sebor/aCC-3.70-15S/lib -lstd15S   -lm 
> Assertion failed: a [start] == vsl [0], file t.cpp, line 19
> ABORT instruction (core dumped)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira