summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/23_containers/unordered_map
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-04-08 16:29:11 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-04-08 17:49:59 +0100
commit1cbba49e3417d9b0661e70301d6fb7a7f52fd360 (patch)
treecc43d05bb09fce4267b812c770fe6160b11113c7 /libstdc++-v3/testsuite/23_containers/unordered_map
parent59d09f9fe4bcf4a341494220be377dfe13d84c1e (diff)
downloadgcc-1cbba49e3417d9b0661e70301d6fb7a7f52fd360.tar.gz
libstdc++: Simplify noexcept-specifiers for move constructors
This puts the logic for the noexcept-specifier in one place, and then reuses it elsewhere. This means checking whether the move constructor can throw doesn't need to do overload resolution and then check whether some other constructor can throw, we just get the answer directly. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable::_S_nothrow_move()): New function to determine noexcept-specifier for move constructors. (_Hashtable): Use _S_nothrow_move() on move constructors. * testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc: Correct static assertion message. * testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc: Likewise. * testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc: Likewise.
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/unordered_map')
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc
index 96245aa4c88..015646adf23 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc
@@ -40,7 +40,7 @@ struct not_noexcept_copy_cons_hash
using type2 = std::unordered_map<int, int, not_noexcept_copy_cons_hash>;
static_assert( !std::is_nothrow_move_constructible<type2>::value,
- "noexcept move constructor" );
+ "not noexcept move constructor" );
static_assert( !std::is_nothrow_constructible<type2, type2&&,
const typename type2::allocator_type&>::value,
"not noexcept move constructor with allocator" );
@@ -59,7 +59,7 @@ using type3 = std::unordered_map<int, int, std::hash<int>,
not_noexcept_copy_cons_equal_to>;
static_assert( !std::is_nothrow_move_constructible<type3>::value,
- "noexcept move constructor" );
+ "not noexcept move constructor" );
static_assert( !std::is_nothrow_constructible<type3, type3&&,
const typename type3::allocator_type&>::value,
"not noexcept move constructor with allocator" );