| Hello,
|
| I found some unexpected behavior in valarray, couldn't find anything
| previous referencing it, and I thought that I'd write before
| (erroneously??) submitting a bug.
|
| Simple case: repeated application of operator==
|
| Silly example:
|
| std::valarray<int> v1(100,1);
| std::valarray<int> v2(100,1);
| std::valarray<bool> v3(100,true);
|
| std::valarray<bool> res;
|
| res = ((v1 == v2) == v3);
|
|
| This returns a compile error.
|
|
| test.cc: In function `int main()':
| test.cc:16: error: no match for 'operator==' in 'std::operator== [with _Tp
| = int](((const std::valarray<int>&)((const std::valarray<int>*)(& v1))),
| ((const std::valarray<int>&)((const std::valarray<int>*)(& v2)))) == v1'
| /usr/include/gcc/darwin/4.0/c++/bits/valarray_after.h:394: note:
| candidates are: std::_Expr<std::_BinClos<std::__equal_to, std::_Expr,
| std::_ValArray, _Dom, typename _Dom::value_type>, typename
| std::__fun<std::__equal_to, typename _Dom1::value_type>::result_type>
| std::operator==(const std::_Expr<_Dom1, typename _Dom1::value_type>&,
| const std::valarray<typename _Dom::value_type>&) [with _Dom =
| std::_BinClos<std::__equal_to, std::_ValArray, std::_ValArray, int, int>]
| /usr/include/gcc/darwin/4.0/c++/bits/valarray_after.h:394: note:
| std::_Expr<std::_BinClos<std::__equal_to, std::_Expr, std::_Constant,
| _Dom, typename _Dom::value_type>, typename std::__fun<std::__equal_to,
| typename _Dom1::value_type>::result_type> std::operator==(const
| std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename
| _Dom::value_type&) [with _Dom = std::_BinClos<std::__equal_to,
| std::_ValArray, std::_ValArray, int, int>]
|
|
| This seems to happen regardless of the type of v3 BTW.

Hmm, that must be a bug; please could you fill a PR in the GCC
bugzilla database

    http://gcc.gnu.org/bugzilla/

and put me ([EMAIL PROTECTED]) in the CC:, and assign it to me?
Thanks!

-- Gaby


-- 
           Summary: compile error in repeated application of
                    valarray<>::operator==
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tegtmeye at eecis dot udel dot edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27867

Reply via email to