diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2019-10-06 10:29:35 +0000 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2019-10-06 10:29:35 +0000 |
commit | 2c6374228bc0aef10b89e5dd9131dbf99477f753 (patch) | |
tree | 76a7f261c398898ff59555a4ae872644d2b8f019 /libstdc++-v3/include | |
parent | b1ca639a8692ac245753b10cb528e0db0f56dd57 (diff) | |
download | gcc-2c6374228bc0aef10b89e5dd9131dbf99477f753.zip gcc-2c6374228bc0aef10b89e5dd9131dbf99477f753.tar.gz gcc-2c6374228bc0aef10b89e5dd9131dbf99477f753.tar.bz2 |
Add std::copy_n __glibcxx_requires_can_increment checks.
* include/bits/stl_algo.h (copy_n): Add __glibcxx_requires_can_increment
debug checks.
* testsuite/25_algorithms/copy_n/debug/1_neg.cc: New.
* testsuite/25_algorithms/copy_n/debug/2_neg.cc: New.
From-SVN: r276636
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/stl_algo.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index b326c63..6dd01e1 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -826,6 +826,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) + __glibcxx_requires_can_increment(__first, __n); + __glibcxx_requires_can_increment(__result, __n); return std::__copy_n(__first, __n, __result, std::__iterator_category(__first)); |