Avoid warnings in tests

This commit is contained in:
Peter Dimov
2022-01-19 18:57:28 +02:00
parent 2f331b7a8b
commit 7d79b35f93
3 changed files with 7 additions and 7 deletions

View File

@ -265,7 +265,7 @@ void test_multiset()
test_set_non_transparent_contains<non_transparent_multiset3>();
}
UNORDERED_AUTO_TEST (contains) {
UNORDERED_AUTO_TEST (contains_) { // avoid -Wshadow warning with `bool contains`
test_map();
test_multimap();
test_set();

View File

@ -1108,7 +1108,7 @@ template <class UnorderedMap> void test_map_transparent_erase()
UnorderedMap map;
unsigned long num_erased = 0;
std::size_t num_erased = 0;
num_erased = map.erase(0);
BOOST_TEST(map.empty());
@ -1150,7 +1150,7 @@ template <class UnorderedMap> void test_map_non_transparent_erase()
UnorderedMap map;
unsigned long num_erased = 0;
std::size_t num_erased = 0;
num_erased = map.erase(0);
BOOST_TEST(map.empty());
@ -1248,7 +1248,7 @@ template <class UnorderedSet> void test_set_transparent_erase()
UnorderedSet set;
unsigned long num_erased = 0;
std::size_t num_erased = 0;
num_erased = set.erase(0);
BOOST_TEST(set.empty());
@ -1290,7 +1290,7 @@ template <class UnorderedSet> void test_set_non_transparent_erase()
UnorderedSet set;
unsigned long num_erased = 0;
std::size_t num_erased = 0;
num_erased = set.erase(0);
BOOST_TEST(set.empty());

View File

@ -552,8 +552,8 @@ namespace unnecessary_copy_tests {
std::pair<count_copies const, count_copies> move_source_trial;
reset();
std::make_tuple(std::move(move_source_trial.first));
std::make_tuple(std::move(move_source_trial.second));
(void)std::make_tuple(std::move(move_source_trial.first));
(void)std::make_tuple(std::move(move_source_trial.second));
int tuple_move_cost = ::unnecessary_copy_tests::count_copies::moves;
int tuple_copy_cost = ::unnecessary_copy_tests::count_copies::copies;