diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-02-24 07:59:08 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-02-24 10:09:52 -0500 |
commit | 85c143d002a31bebb675161315c8e62db240b636 (patch) | |
tree | e3150cb35e03a6126eaf935bcf0020859f8f9eb5 /gcc/fortran/simplify.c | |
parent | c5eab4ed45e9762dfb8a58d2b5672d358467ad89 (diff) | |
download | gcc-85c143d002a31bebb675161315c8e62db240b636.zip gcc-85c143d002a31bebb675161315c8e62db240b636.tar.gz gcc-85c143d002a31bebb675161315c8e62db240b636.tar.bz2 |
libstdc++: Add missing bits of P0896R4 pertaining to [back|front]_insert_iterator
This adds some missing pieces of the Ranges TS that make back_insert_iterator and
front_insert_iterator conform to the new output_iterator requirements.
It also fixes a bug in ranges::__copy_or_move and
ranges::__copy_or_move_backward in which we were inspecting the iter_value_t of
the output iterator, but output iterators such as back_insert_iterator and
front_insert_iterator whose value_type = void do not have an iter_value_t
according to [readable.traits] p4. The entire __use_memmove condition should
probably be rewritten, but the simplest fix for now is to inspect the
iterator_traits of the output iterator instead.
libstdc++-v3/ChangeLog:
PR libstdc++/93884
* include/bits/ranges_algobase.h (__copy_or_move,
__copy_or_move_backward): Don't inspect the iter_value_t of the output
iterator, instead inspect its iterator_traits directly.
* include/bits/stl_iterator.h (back_insert_iterator::container):
Conditionally initialize.
(back_insert_iterator::difference_type): Conditionally define.
(back_insert_iterator::back_insert_iterator): Conditionally define this
default constructor.
(front_insert_iterator::container): Conditionally initialize.
(front_insert_iterator::difference_type): Conditionally define.
(front_insert_iterator::front_insert_iterator): Conditionally define
this default constructor.
* 24_iterators/back_insert_iterator/pr93884.cc: New test.
* 24_iterators/front_insert_iterator/pr93884.cc: New test.
Diffstat (limited to 'gcc/fortran/simplify.c')
0 files changed, 0 insertions, 0 deletions