https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91748
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Author: redi Date: Thu Sep 12 10:51:39 2019 New Revision: 275683 URL: https://gcc.gnu.org/viewcvs?rev=275683&root=gcc&view=rev Log: PR libstdc++/91748 fix std::for_each_n for random access iterators PR libstdc++/91748 * include/bits/stl_algo.h (for_each_n): Fix random access iterator case. * testsuite/25_algorithms/for_each/for_each_n.cc: Test with random access iterators. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/bits/stl_algo.h trunk/libstdc++-v3/testsuite/25_algorithms/for_each/for_each_n.cc