mirror of git://gcc.gnu.org/git/gcc.git
Use the value of the first element as the initial value of the __valarray_sum accumulator. Value-initialization might not create the additive identity for the value type. Make a similar change to __valarray_product even though it's only ever used internally with a value_type of size_t. PR libstdc++/87641 * include/bits/valarray_array.h (__valarray_sum): Use first element to initialize accumulator instead of value-initializing it. (__valarray_product<_Tp>): Move to ... * src/c++98/valarray.cc (__valarray_product<_Tp>): Here. Use first element to initialize accumulator. (__valarray_product(const valarray<size_t>&)): Remove const_cast made unnecessary by LWG 389. * testsuite/26_numerics/valarray/87641.cc: New test. From-SVN: r265270 |
||
|---|---|---|
| .. | ||
| requirements | ||
| 27867.cc | ||
| 28277.cc | ||
| 30416.cc | ||
| 33084.cc | ||
| 40691.cc | ||
| 69116.cc | ||
| 83860.cc | ||
| 87641.cc | ||
| algo.cc | ||
| binary_closure.cc | ||
| const_bracket.cc | ||
| deduction.cc | ||
| dr543.cc | ||
| dr630-1.cc | ||
| dr630-2.cc | ||
| dr630-3.C | ||
| init-list.cc | ||
| moveable.cc | ||
| name_lookup.cc | ||
| noexcept_move_construct.cc | ||
| operators.cc | ||
| range_access.cc | ||
| range_access2.cc | ||
| subset_assignment.cc | ||
| swap.cc | ||
| transcend.cc | ||