https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94418
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:d335d73889d897d073b987b4323db05317fccad3 commit r12-4063-gd335d73889d897d073b987b4323db05317fccad3 Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed Apr 28 11:40:47 2021 +0100 libstdc++: Use conditional noexcept in std::reverse_iterator [PR 94418] This adds a noexcept-specifier to each constructor and assignment operator of std::reverse_iterator so that they are noexcept when the corresponding operation on the underlying iterator is noexcept. The std::reverse_iterator class template already requires that the operations on the underlying type are valid, so we don't need to use the std::is_nothrow_xxx traits to protect against errors when the expression isn't even valid. We can just use a noexcept operator to test if the expression can throw, without the overhead of redundantly checking if the initialization/assignment would be valid. Signed-off-by: Jonathan Wakely <jwak...@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/94418 * include/bits/stl_iterator.h (reverse_iterator): Use conditional noexcept on constructors and assignment operators. * testsuite/24_iterators/reverse_iterator/noexcept.cc: New test.