aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-04-29 13:12:43 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-04-29 13:12:43 +0100
commit846541dd15c8390f61d3d3c01626975af79d96be (patch)
treeacdd7472ab025aaa6f9568c19f2a8c0e154a506c /gcc
parentca0ddb398fb6173eb97c5d70265e79b9ea2bdc9d (diff)
downloadgcc-846541dd15c8390f61d3d3c01626975af79d96be.zip
gcc-846541dd15c8390f61d3d3c01626975af79d96be.tar.gz
gcc-846541dd15c8390f61d3d3c01626975af79d96be.tar.bz2
PR libstdc++/87982 Fix generate_n and fill_n use of _Size parameter
The standard only requires that _Size can be converted to an integral type, not that it can be used for arithmetic. Add a new set of __size_to_integer helper functions to do the conversion (which will be ambiguous if there is no one conversion that is better than any others). Also add tests for DR 426 which requires these algorithms and search_n to handle negative values of n. PR libstdc++/87982 * include/bits/stl_algo.h (generate_n): Convert _Size parameter to an integral type. * include/bits/stl_algobase.h (__size_to_integer): New overloaded functions to convert a value to an integral type. (__fill_n_a, __fill_n_a): Assert that __n is already an integral type. (fill_n): Convert _Size parameter to an integral type. * testsuite/25_algorithms/fill_n/dr426.cc: New test. * testsuite/25_algorithms/generate_n/87982.cc: New test. * testsuite/25_algorithms/generate_n/dr426.cc: New test. From-SVN: r270646
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions