Protect more algorithms from overloaded comma operators
authorJonathan Wakely <jwakely@redhat.com>
Thu, 26 Oct 2017 23:50:40 +0000 (00:50 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 26 Oct 2017 23:50:40 +0000 (00:50 +0100)
commitd67be4437a94b3f261ee22515b9508da59c691ef
tree102e630a448b23221458eabdc5ea069db19503fc
parente1b76fde8ffaa74dffc895c2e2e625e30428b435
Protect more algorithms from overloaded comma operators

* include/bits/stl_algo.h (__find_if_not_n, generate_n): Cast to void
to ensure overloaded comma not used.
* include/bits/stl_algobase.h (__fill_n_a, equal): Likewise.
* include/bits/stl_uninitialized.h (__uninitialized_fill_n)
(__uninitialized_fill_n_a, __uninitialized_default_n_1)
(__uninitialized_default_n_a, __uninitialized_copy_n)
(__uninitialized_copy_n_pair): Likewise
* testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc:
Use test iterator wrappers with overloaded comma operator.
* testsuite/25_algorithms/fill_n/1.cc: Likewise.
* testsuite/25_algorithms/generate_n/1.cc: New test.
* testsuite/25_algorithms/stable_partition/1.cc: New test.
* testsuite/util/testsuite_iterators.h (operator,): Add deleted
non-member comma operator with iterator wrappers as right operand.

From-SVN: r254128
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/stl_uninitialized.h
libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc
libstdc++-v3/testsuite/25_algorithms/fill_n/1.cc
libstdc++-v3/testsuite/25_algorithms/generate_n/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/stable_partition/1.cc
libstdc++-v3/testsuite/util/testsuite_iterators.h