public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/27867]  New: compile error in repeated application of valarray<>::operator==
@ 2006-06-01 18:59 tegtmeye at eecis dot udel dot edu
  2006-06-01 21:37 ` [Bug libstdc++/27867] " pcarlini at suse dot de
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tegtmeye at eecis dot udel dot edu @ 2006-06-01 18:59 UTC (permalink / raw)
  To: gcc-bugs

| 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 (gdr@gcc.gnu.org) 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/27867] compile error in repeated application of valarray<>::operator==
  2006-06-01 18:59 [Bug libstdc++/27867] New: compile error in repeated application of valarray<>::operator== tegtmeye at eecis dot udel dot edu
@ 2006-06-01 21:37 ` pcarlini at suse dot de
  2006-06-02  2:21 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pcarlini at suse dot de @ 2006-06-01 21:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pcarlini at suse dot de  2006-06-01 21:37 -------
Gaby, I had a quick look and maybe it's just a trivial typo: the below seems
right to me and certainly fixes the testcase without regressions... What do you
 think?

Thanks, Paolo.

//////////////

Index: include/bits/valarray_before.h
===================================================================
--- include/bits/valarray_before.h      (revision 114214)
+++ include/bits/valarray_before.h      (working copy)
@@ -589,7 +589,7 @@
     : _BinBase<_Oper, valarray<_Tp>, valarray<_Tp> >
     {
       typedef _BinBase<_Oper, valarray<_Tp>, valarray<_Tp> > _Base;
-      typedef _Tp value_type;
+      typedef typename _Base::value_type value_type;

       _BinClos(const valarray<_Tp>& __v, const valarray<_Tp>& __w)
       : _Base(__v, __w) {}


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pcarlini at suse dot de


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/27867] compile error in repeated application of valarray<>::operator==
  2006-06-01 18:59 [Bug libstdc++/27867] New: compile error in repeated application of valarray<>::operator== tegtmeye at eecis dot udel dot edu
  2006-06-01 21:37 ` [Bug libstdc++/27867] " pcarlini at suse dot de
@ 2006-06-02  2:21 ` pinskia at gcc dot gnu dot org
  2006-06-04  9:33 ` paolo at gcc dot gnu dot org
  2006-06-04  9:34 ` pcarlini at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-02  2:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-06-02 02:21 -------
Confirmed on both GDR saying this is a bug and Paolo providing a patch to fix
this.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-06-02 02:21:08
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/27867] compile error in repeated application of valarray<>::operator==
  2006-06-01 18:59 [Bug libstdc++/27867] New: compile error in repeated application of valarray<>::operator== tegtmeye at eecis dot udel dot edu
  2006-06-01 21:37 ` [Bug libstdc++/27867] " pcarlini at suse dot de
  2006-06-02  2:21 ` pinskia at gcc dot gnu dot org
@ 2006-06-04  9:33 ` paolo at gcc dot gnu dot org
  2006-06-04  9:34 ` pcarlini at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu dot org @ 2006-06-04  9:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo at gcc dot gnu dot org  2006-06-04 09:33 -------
Subject: Bug 27867

Author: paolo
Date: Sun Jun  4 09:32:56 2006
New Revision: 114356

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114356
Log:
2006-06-04  Paolo Carlini  <pcarlini@suse.de>

        PR libstdc++/27867
        * include/bits/valarray_before.h (struct _BinClos<_Oper, _ValArray,
        _ValArray, _Tp, _Tp>): Fix value_type typedef.
        * testsuite/26_numerics/valarray/27867.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/26_numerics/valarray/27867.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/valarray_before.h


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/27867] compile error in repeated application of valarray<>::operator==
  2006-06-01 18:59 [Bug libstdc++/27867] New: compile error in repeated application of valarray<>::operator== tegtmeye at eecis dot udel dot edu
                   ` (2 preceding siblings ...)
  2006-06-04  9:33 ` paolo at gcc dot gnu dot org
@ 2006-06-04  9:34 ` pcarlini at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: pcarlini at suse dot de @ 2006-06-04  9:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pcarlini at suse dot de  2006-06-04 09:34 -------
Fixed.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.2.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-04  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-01 18:59 [Bug libstdc++/27867] New: compile error in repeated application of valarray<>::operator== tegtmeye at eecis dot udel dot edu
2006-06-01 21:37 ` [Bug libstdc++/27867] " pcarlini at suse dot de
2006-06-02  2:21 ` pinskia at gcc dot gnu dot org
2006-06-04  9:33 ` paolo at gcc dot gnu dot org
2006-06-04  9:34 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).