diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-05-26 12:41:03 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-05-26 17:14:40 +0100 |
commit | 47b20d027ade5bfbd932724d0ea2aedee7421243 (patch) | |
tree | 4c0920e66d2be2518a491d04e28870cceaeca3a8 /libstdc++-v3/include | |
parent | 97dc78d705a90c1ae83c78a7f2e24942cc3a6257 (diff) | |
download | gcc-47b20d027ade5bfbd932724d0ea2aedee7421243.zip gcc-47b20d027ade5bfbd932724d0ea2aedee7421243.tar.gz gcc-47b20d027ade5bfbd932724d0ea2aedee7421243.tar.bz2 |
libstdc++: Add constexpr to std::counted_iterator post-increment (LWG 3643)
libstdc++-v3/ChangeLog:
* include/bits/stl_iterator.h (counted_iterator::operator++(int)):
Add 'constexpr' as per LWG 3643.
* testsuite/24_iterators/counted_iterator/lwg3643.cc: New test.
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/stl_iterator.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index 6a9fd1b..12a89ab 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -2341,7 +2341,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *this; } - decltype(auto) + constexpr decltype(auto) operator++(int) { __glibcxx_assert(_M_length > 0); @@ -2353,7 +2353,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ++_M_length; __throw_exception_again; } - } constexpr counted_iterator |