c9dce3b15e
The std::uninitialized_fill_n algorithm uses sd::fill_n for trivial types, but that algorithm has a stronger requirement that the Size parameter is convertible to an integral type. As the new test shows, there are types which are valid for std::uninitialized_fill_n but which produce a different result when converted to an integral type, or cannot be converted at all. Only use the std::fill_n optimization when the Size type is already an integral type. The std::__uninitialized_default_n extension has the same problem, and so does C++17's std::uninitialized_value_construct_n which uses it. * include/bits/stl_uninitialized.h (uninitialized_fill_n): Only use std::fill_n when the size is an integral type. (__uninitialized_default_n): Likewise. * testsuite/20_util/specialized_algorithms/uninitialized_default_n/sizes.cc: New test. * testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc: New test. * testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/sizes.cc: New test. |
||
---|---|---|
.. | ||
config | ||
doc | ||
include | ||
libsupc++ | ||
po | ||
python | ||
scripts | ||
src | ||
testsuite | ||
acinclude.m4 | ||
aclocal.m4 | ||
ChangeLog | ||
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 | ||
ChangeLog-2017 | ||
ChangeLog-2018 | ||
ChangeLog-2019 | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.host | ||
crossconfig.m4 | ||
fragment.am | ||
linkage.m4 | ||
Makefile.am | ||
Makefile.in | ||
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.