gcc/libstdc++-v3
Jonathan Wakely fab2c75b73 PR libstdc++/87641 correctly initialize accumulator in valarray::sum()
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
2018-10-18 16:38:50 +01:00
..
config PR libstdc++/87618 fix typos in linker script 2018-10-16 12:14:37 +01:00
doc allocator.xml: Adjust link to "Reconsidering Custom Memory Allocation". 2018-10-01 15:17:15 +00:00
include PR libstdc++/87641 correctly initialize accumulator in valarray::sum() 2018-10-18 16:38:50 +01:00
libsupc++ * libsupc++/cxxabi.h (__cxa_demangle): Clarify doxygen comment. 2018-09-05 16:18:16 +01:00
po PR libstdc++/86450 use -Wabi=2 and simplify -Werror use 2018-07-17 14:18:47 +01:00
python Define std::string and related typedefs outside __cxx11 namespace 2018-10-09 14:06:46 +01:00
scripts Fix comments in testsuite script 2018-08-23 16:10:35 +01:00
src PR libstdc++/87641 correctly initialize accumulator in valarray::sum() 2018-10-18 16:38:50 +01:00
testsuite PR libstdc++/87641 correctly initialize accumulator in valarray::sum() 2018-10-18 16:38:50 +01:00
ChangeLog PR libstdc++/87641 correctly initialize accumulator in valarray::sum() 2018-10-18 16:38:50 +01:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016 Update copyright years. 2017-01-01 13:07:43 +01:00
ChangeLog-2017 Update copyright years. 2018-01-03 11:03:58 +01:00
Makefile.am Update copyright years. 2018-01-03 11:03:58 +01:00
Makefile.in PR libstdc++/86450 use -Wabi=2 and simplify -Werror use 2018-07-17 14:18:47 +01:00
README
acinclude.m4 Define _GLIBCXX_USE_DEV_RANDOM as replacement for _GLIBCXX_USE_RANDOM_TR1 2018-10-16 15:49:29 +01:00
aclocal.m4 Build libgo with -Wa,-nH if possible (PR go/78978) [non-libgo parts] 2017-01-06 14:33:47 +00:00
config.h.in Use autoconf to check for features needed by Networking TS 2018-10-16 17:12:32 +01:00
configure Use autoconf to check for features needed by Networking TS 2018-10-16 17:12:32 +01:00
configure.ac Use autoconf to check for features needed by Networking TS 2018-10-16 17:12:32 +01:00
configure.host Don't force visibility to hidden for Darwin > 8. 2018-08-25 09:02:28 +00:00
crossconfig.m4 Define _GLIBCXX_USE_DEV_RANDOM as replacement for _GLIBCXX_USE_RANDOM_TR1 2018-10-16 15:49:29 +01:00
fragment.am PR libstdc++/86450 use -Wabi=2 and simplify -Werror use 2018-07-17 14:18:47 +01:00
linkage.m4

README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.