This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] libstdc++/33084
- From: Paolo Carlini <pcarlini at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Aug 2007 13:10:21 +0200
- Subject: [v3] libstdc++/33084
Hi,
tested x86_64-linux, committed to mainline and 4_2-branch.
Paolo.
/////////////////
2007-08-17 Johannes Willkomm <willkomm@sc.rwth-aachen.de>
PR libstdc++/33084
* include/std/valarray (operator _Op(const _Tp&,
const valarray<>&)): Fix typo.
* testsuite/26_numerics/numeric_arrays/valarray/33084.cc: New.
Index: include/std/valarray
===================================================================
--- include/std/valarray (revision 127534)
+++ include/std/valarray (working copy)
@@ -1009,7 +1009,7 @@
{ \
typedef _BinClos<_Name, _Constant, _ValArray, _Tp, _Tp> _Closure; \
typedef typename __fun<_Name, _Tp>::result_type _Rt; \
- return _Expr<_Closure, _Tp>(_Closure(__t, __v)); \
+ return _Expr<_Closure, _Rt>(_Closure(__t, __v)); \
}
_DEFINE_BINARY_OPERATOR(+, __plus)
Index: testsuite/26_numerics/numeric_arrays/valarray/33084.cc
===================================================================
--- testsuite/26_numerics/numeric_arrays/valarray/33084.cc (revision 0)
+++ testsuite/26_numerics/numeric_arrays/valarray/33084.cc (revision 0)
@@ -0,0 +1,46 @@
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// { dg-do compile }
+
+#include <valarray>
+
+// libstdc++/33084
+void test01()
+{
+ std::valarray<char> vc(char(0), 10);
+ std::valarray<bool> res(10);
+ char c(0);
+
+ res = c == vc;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}