aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Willkomm <willkomm@sc.rwth-aachen.de>2007-08-17 09:27:06 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2007-08-17 09:27:06 +0000
commit5837d3c8f00558d1b8f1091fda92a808e5c29b15 (patch)
treed9a19437289ef53f79220c90fce6e8c07641075b
parentb79f09ac80dd67134e2b9b0926601cbebed2db42 (diff)
downloadgcc-5837d3c8f00558d1b8f1091fda92a808e5c29b15.zip
gcc-5837d3c8f00558d1b8f1091fda92a808e5c29b15.tar.gz
gcc-5837d3c8f00558d1b8f1091fda92a808e5c29b15.tar.bz2
re PR libstdc++/33084 (Small typo in valarray header)
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. From-SVN: r127579
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/include/std/valarray2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/33084.cc48
3 files changed, 56 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d123101..2c473b0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2007-08-07 Jim Blandy <jimb@codesourcery.com>
* src/Makefile.am (libstdc++-symbol.ver): Make
diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray
index 4898c15..c8084fd 100644
--- a/libstdc++-v3/include/std/valarray
+++ b/libstdc++-v3/include/std/valarray
@@ -1009,7 +1009,7 @@ _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, __shift_right)
{ \
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)
diff --git a/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/33084.cc b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/33084.cc
new file mode 100644
index 0000000..aaacfe7
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/numeric_arrays/valarray/33084.cc
@@ -0,0 +1,48 @@
+// 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 = vc == vc;
+ res = vc == c;
+ res = c == vc;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}