libstdc++: Avoid warnings in tests
authorJonathan Wakely <jwakely@redhat.com>
Thu, 29 Oct 2020 22:47:21 +0000 (22:47 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 29 Oct 2020 22:47:21 +0000 (22:47 +0000)
commit13feb0234b136fbdc1dbfba3a9663fb4e1043f75
treed05a39206b08d2b19889146875b6cb6aac63abc0
parent11dc4c4e137a9b48d585d7b1b146fb8404e3e1fe
libstdc++: Avoid warnings in tests

This fixes some warnings emitted when testing with warning flags added.
Some of these are only necessary when testing with -Wsystem-headers, but
either way it cleans up the tests to be less noisy under non-default
flags.

libstdc++-v3/ChangeLog:

* testsuite/18_support/96817.cc: Avoid -Wunused warnings.
* testsuite/20_util/any/assign/2.cc: Likewise.
* testsuite/20_util/any/cons/2.cc: Likewise.
* testsuite/20_util/align/1.cc: Avoid -Wsign-compare warning.
* testsuite/20_util/function/65760.cc: Avoid -Wunused warning.
* testsuite/20_util/function/1.cc: Avoid -Wcatch-value warning.
* testsuite/20_util/function/cons/move_target.cc: Avoid -Wunused
warning.
* testsuite/20_util/headers/memory/synopsis.cc: Add exception
specification.
* testsuite/20_util/monotonic_buffer_resource/allocate.cc: Avoid
-Wsign-compare warning.
* testsuite/20_util/tuple/cons/deduction.cc: Avoid -Wunused
warning.
* testsuite/20_util/specialized_algorithms/uninitialized_copy/808590-cxx11.cc:
Avoid -Wdeprecated-copy warning.
* testsuite/21_strings/basic_string/56166.cc: Avoid
-Wcatch-value warning.
* testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
Avoid -Wcatch-value warnings.
* testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc:
Prune additional diagnostics.
* testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc:
Likewise.
* testsuite/21_strings/headers/string/synopsis.cc: Add exception
specifications.
* testsuite/22_locale/locale/cons/12352.cc: Define sized
delete operators to avoid warnings.
* testsuite/23_containers/deque/modifiers/swap/1.cc: Add
exception specification.
* testsuite/23_containers/forward_list/cons/11.cc: Avoid
-Wdeprecated-copy warning.
* testsuite/23_containers/headers/bitset/synopsis.cc: Add
exception specification.
* testsuite/23_containers/headers/deque/synopsis.cc: Likewise.
* testsuite/23_containers/headers/forward_list/synopsis.cc:
Likewise.
* testsuite/23_containers/headers/list/synopsis.cc: Likewise.
* testsuite/23_containers/headers/map/synopsis.cc: Likewise.
* testsuite/23_containers/headers/queue/synopsis.cc: Likewise.
* testsuite/23_containers/headers/set/synopsis.cc: Likewise.
* testsuite/23_containers/headers/vector/synopsis.cc: Likewise.
* testsuite/23_containers/list/modifiers/swap/1.cc: Likewise.
* testsuite/23_containers/map/modifiers/swap/1.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/swap/1.cc:
Likewise.
* testsuite/23_containers/multiset/modifiers/swap/1.cc:
Likewise.
* testsuite/23_containers/set/modifiers/swap/1.cc: Likewise.
* testsuite/23_containers/unordered_set/56267-2.cc: Avoid
-Wdeprecated-copy warning.
* testsuite/23_containers/vector/bool/23632.cc: Avoid
-Wempty-body warning.
* testsuite/23_containers/vector/modifiers/swap/1.cc: Add
exception specification.
* testsuite/25_algorithms/heap/moveable2.cc: Fix misplaced
parentheses around arguments.
* testsuite/25_algorithms/sample/1.cc: Use return value.
* testsuite/25_algorithms/search/searcher.cc: Avoid -Wunused
warnings.
* testsuite/27_io/basic_ostream/exceptions/char/9561.cc:
Likewise.
* testsuite/27_io/basic_ostream/exceptions/wchar_t/9561.cc:
Likewise.
* testsuite/27_io/filesystem/operations/remove_all.cc: Avoid
-Wsign-compare warning.
* testsuite/experimental/any/assign/2.cc: Avoid -Wunused warnings.
* testsuite/experimental/any/cons/2.cc: Likewise.
* testsuite/experimental/filesystem/operations/remove_all.cc:
Avoid -Wign-compare warning.
* testsuite/experimental/memory/observer_ptr/cons/cons.cc:
Likewise.
* testsuite/experimental/memory_resource/null_memory_resource.cc:
Likewise.
* testsuite/experimental/source_location/1.cc: Avoid -Waddress
warning.
* testsuite/ext/pod_char_traits.cc: Avoid -Wunused warning.
* testsuite/ext/vstring/modifiers/clear/56166.cc: Avoid
-Wcatch-value.
* testsuite/std/concepts/concepts.lang/concept.swappable/swap.cc:
Avoid -Wunused warning.
* testsuite/std/concepts/concepts.lang/concept.swappable/swappable.cc:
Likewise.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc:
Prune additional warnings.
* testsuite/tr1/3_function_objects/function/1.cc: Avoid
-Wcatch-value warning.
* testsuite/util/replacement_memory_operators.h: Define sized
delete to avoid warnings.
* testsuite/util/testsuite_api.h (_NonDefaultConstructible): Add
user-declared assignment operator to stop -Wdeprecated-copy
warnings.
* testsuite/util/testsuite_containers.h: Avoid -Wunused warning.
* testsuite/util/testsuite_iterators.h: Avoid -Wsign-compare
warnings.
* testsuite/util/testsuite_new_operators.h: Define sized deleted.
74 files changed:
libstdc++-v3/testsuite/18_support/96817.cc
libstdc++-v3/testsuite/20_util/align/1.cc
libstdc++-v3/testsuite/20_util/any/assign/2.cc
libstdc++-v3/testsuite/20_util/any/cons/2.cc
libstdc++-v3/testsuite/20_util/function/1.cc
libstdc++-v3/testsuite/20_util/function/65760.cc
libstdc++-v3/testsuite/20_util/function/cons/move_target.cc
libstdc++-v3/testsuite/20_util/headers/memory/synopsis.cc
libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc
libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/808590-cxx11.cc
libstdc++-v3/testsuite/20_util/tuple/cons/deduction.cc
libstdc++-v3/testsuite/21_strings/basic_string/56166.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/nonnull.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/nonnull.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/nonnull.cc
libstdc++-v3/testsuite/21_strings/headers/string/synopsis.cc
libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc
libstdc++-v3/testsuite/23_containers/deque/modifiers/swap/1.cc
libstdc++-v3/testsuite/23_containers/forward_list/cons/11.cc
libstdc++-v3/testsuite/23_containers/headers/bitset/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/deque/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/forward_list/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/list/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/map/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/queue/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/set/synopsis.cc
libstdc++-v3/testsuite/23_containers/headers/vector/synopsis.cc
libstdc++-v3/testsuite/23_containers/list/modifiers/swap/1.cc
libstdc++-v3/testsuite/23_containers/map/modifiers/swap/1.cc
libstdc++-v3/testsuite/23_containers/multimap/modifiers/swap/1.cc
libstdc++-v3/testsuite/23_containers/multiset/modifiers/swap/1.cc
libstdc++-v3/testsuite/23_containers/set/modifiers/swap/1.cc
libstdc++-v3/testsuite/23_containers/unordered_set/56267-2.cc
libstdc++-v3/testsuite/23_containers/vector/bool/23632.cc
libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/1.cc
libstdc++-v3/testsuite/25_algorithms/heap/moveable2.cc
libstdc++-v3/testsuite/25_algorithms/sample/1.cc
libstdc++-v3/testsuite/25_algorithms/search/searcher.cc
libstdc++-v3/testsuite/27_io/basic_ostream/exceptions/char/9561.cc
libstdc++-v3/testsuite/27_io/basic_ostream/exceptions/wchar_t/9561.cc
libstdc++-v3/testsuite/27_io/filesystem/operations/remove_all.cc
libstdc++-v3/testsuite/experimental/any/assign/2.cc
libstdc++-v3/testsuite/experimental/any/cons/2.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/remove_all.cc
libstdc++-v3/testsuite/experimental/memory/observer_ptr/cons/cons.cc
libstdc++-v3/testsuite/experimental/memory_resource/null_memory_resource.cc
libstdc++-v3/testsuite/experimental/source_location/1.cc
libstdc++-v3/testsuite/ext/pod_char_traits.cc
libstdc++-v3/testsuite/ext/vstring/modifiers/clear/56166.cc
libstdc++-v3/testsuite/std/concepts/concepts.lang/concept.swappable/swap.cc
libstdc++-v3/testsuite/std/concepts/concepts.lang/concept.swappable/swappable.cc
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc
libstdc++-v3/testsuite/tr1/3_function_objects/function/1.cc
libstdc++-v3/testsuite/util/replacement_memory_operators.h
libstdc++-v3/testsuite/util/testsuite_api.h
libstdc++-v3/testsuite/util/testsuite_containers.h
libstdc++-v3/testsuite/util/testsuite_iterators.h
libstdc++-v3/testsuite/util/testsuite_new_operators.h