aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-07-20 12:49:28 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-07-20 23:34:20 +0100
commit3b5567c3ec7e5759bdecc6a6fc0be2b65a93636e (patch)
treec8133dca1c61c878ed8f7850dde3a670cc604f6c /gcc
parent5e830693dd335621940368b6d39b23afc2c98545 (diff)
downloadgcc-3b5567c3ec7e5759bdecc6a6fc0be2b65a93636e.zip
gcc-3b5567c3ec7e5759bdecc6a6fc0be2b65a93636e.tar.gz
gcc-3b5567c3ec7e5759bdecc6a6fc0be2b65a93636e.tar.bz2
libstdc++: Fix minor bugs in std::common_iterator
The noexcept-specifier for some std::common_iterator constructors was incorrectly using an rvalue as the first argument of std::is_nothrow_assignable_v. This gave the wrong answer for some types, e.g. std::common_iterator<int*, S>, because an rvalue of scalar type cannot be assigned to. Also fix the friend declaration to use the same constraints as on the definition of the class template. G++ fails to diagnose this error, due to PR c++/96830. Finally, the copy constructor was using std::move for its argument in some cases, which should be removed. libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (common_iterator): Fix incorrect uses of is_nothrow_assignable_v. Fix inconsistent constraints on friend declaration. Do not move argument in copy constructor. * testsuite/24_iterators/common_iterator/1.cc: Check for noexcept constructibnle/assignable.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions