From 9ae62c79cc771ff6cefcd2a98f69ecf7b40ebd71 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 15 Nov 2017 07:40:37 +0000 Subject: Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318276 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/std/containers/associative/map/map.ops/count0.pass.cpp | 4 ++-- test/std/containers/associative/map/map.ops/count1.fail.cpp | 2 +- test/std/containers/associative/map/map.ops/count2.fail.cpp | 2 +- test/std/containers/associative/map/map.ops/count3.fail.cpp | 2 +- .../containers/associative/map/map.ops/equal_range0.pass.cpp | 10 ++++++++-- .../containers/associative/map/map.ops/equal_range1.fail.cpp | 2 +- .../containers/associative/map/map.ops/equal_range2.fail.cpp | 2 +- .../containers/associative/map/map.ops/equal_range3.fail.cpp | 2 +- test/std/containers/associative/map/map.ops/find0.pass.cpp | 6 ++++-- test/std/containers/associative/map/map.ops/find1.fail.cpp | 2 +- test/std/containers/associative/map/map.ops/find2.fail.cpp | 2 +- test/std/containers/associative/map/map.ops/find3.fail.cpp | 2 +- .../containers/associative/map/map.ops/lower_bound0.pass.cpp | 6 ++++-- .../containers/associative/map/map.ops/lower_bound1.fail.cpp | 2 +- .../containers/associative/map/map.ops/lower_bound2.fail.cpp | 2 +- .../containers/associative/map/map.ops/lower_bound3.fail.cpp | 2 +- .../containers/associative/map/map.ops/upper_bound0.pass.cpp | 6 ++++-- .../containers/associative/map/map.ops/upper_bound1.fail.cpp | 2 +- .../containers/associative/map/map.ops/upper_bound2.fail.cpp | 2 +- .../containers/associative/map/map.ops/upper_bound3.fail.cpp | 2 +- .../associative/multimap/multimap.ops/count0.pass.cpp | 4 ++-- .../associative/multimap/multimap.ops/count1.fail.cpp | 2 +- .../associative/multimap/multimap.ops/count2.fail.cpp | 2 +- .../associative/multimap/multimap.ops/count3.fail.cpp | 2 +- .../associative/multimap/multimap.ops/equal_range0.pass.cpp | 10 ++++++++-- .../associative/multimap/multimap.ops/equal_range1.fail.cpp | 2 +- .../associative/multimap/multimap.ops/equal_range2.fail.cpp | 2 +- .../associative/multimap/multimap.ops/equal_range3.fail.cpp | 2 +- .../associative/multimap/multimap.ops/find0.pass.cpp | 6 ++++-- .../associative/multimap/multimap.ops/find1.fail.cpp | 2 +- .../associative/multimap/multimap.ops/find2.fail.cpp | 2 +- .../associative/multimap/multimap.ops/find3.fail.cpp | 2 +- .../associative/multimap/multimap.ops/lower_bound0.pass.cpp | 6 ++++-- .../associative/multimap/multimap.ops/lower_bound1.fail.cpp | 2 +- .../associative/multimap/multimap.ops/lower_bound2.fail.cpp | 2 +- .../associative/multimap/multimap.ops/lower_bound3.fail.cpp | 2 +- .../associative/multimap/multimap.ops/upper_bound0.pass.cpp | 6 ++++-- .../associative/multimap/multimap.ops/upper_bound1.fail.cpp | 2 +- .../associative/multimap/multimap.ops/upper_bound2.fail.cpp | 2 +- .../associative/multimap/multimap.ops/upper_bound3.fail.cpp | 2 +- test/std/iterators/iterators.general/gcc_workaround.pass.cpp | 4 ++-- .../move.iter.nonmember/make_move_iterator.pass.cpp | 4 ++-- test/std/strings/basic.string/string.access/at.pass.cpp | 4 ++-- .../string.ops/string_compare/size_size_T_size_size.pass.cpp | 4 ++-- .../string.ops/string_compare/size_size_pointer.pass.cpp | 2 +- .../string.ops/string_compare/size_size_pointer_size.pass.cpp | 2 +- .../string.ops/string_compare/size_size_string.pass.cpp | 2 +- .../string_compare/size_size_string_size_size.pass.cpp | 4 ++-- .../string.ops/string_compare/size_size_string_view.pass.cpp | 2 +- test/std/strings/string.view/string.view.access/at.pass.cpp | 2 +- test/std/utilities/any/any.nonmembers/make_any.pass.cpp | 4 ++-- .../util.smartptr.ownerless/owner_less.pass.cpp | 2 +- .../optional.object/optional.object.observe/value.pass.cpp | 2 +- .../optional.object.observe/value_const.pass.cpp | 2 +- .../optional.object.observe/value_const_rvalue.pass.cpp | 2 +- .../optional.object.observe/value_rvalue.pass.cpp | 2 +- test/std/utilities/variant/variant.get/get_index.pass.cpp | 2 +- test/std/utilities/variant/variant.get/get_type.pass.cpp | 2 +- 58 files changed, 98 insertions(+), 74 deletions(-) (limited to 'test') diff --git a/test/std/containers/associative/map/map.ops/count0.pass.cpp b/test/std/containers/associative/map/map.ops/count0.pass.cpp index 1fa8c4a70..5649c57f2 100644 --- a/test/std/containers/associative/map/map.ops/count0.pass.cpp +++ b/test/std/containers/associative/map/map.ops/count0.pass.cpp @@ -30,10 +30,10 @@ int main() { { typedef std::map M; - M().count(C2Int{5}); + assert(M().count(C2Int{5}) == 0); } { typedef std::map M; - M().count(C2Int{5}); + assert(M().count(C2Int{5}) == 0); } } diff --git a/test/std/containers/associative/map/map.ops/count1.fail.cpp b/test/std/containers/associative/map/map.ops/count1.fail.cpp index bd0bf2ec4..5ad176142 100644 --- a/test/std/containers/associative/map/map.ops/count1.fail.cpp +++ b/test/std/containers/associative/map/map.ops/count1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/count2.fail.cpp b/test/std/containers/associative/map/map.ops/count2.fail.cpp index ff4bed8cb..bb1c32e0e 100644 --- a/test/std/containers/associative/map/map.ops/count2.fail.cpp +++ b/test/std/containers/associative/map/map.ops/count2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/count3.fail.cpp b/test/std/containers/associative/map/map.ops/count3.fail.cpp index 55a463ed3..8964384de 100644 --- a/test/std/containers/associative/map/map.ops/count3.fail.cpp +++ b/test/std/containers/associative/map/map.ops/count3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp b/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp index c254fb6a7..310db6d89 100644 --- a/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp +++ b/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp @@ -30,10 +30,16 @@ int main() { { typedef std::map M; - M().equal_range(C2Int{5}); + typedef std::pair P; + M example; + P result = example.equal_range(C2Int{5}); + assert(result.first == result.second); } { typedef std::map M; - M().equal_range(C2Int{5}); + typedef std::pair P; + M example; + P result = example.equal_range(C2Int{5}); + assert(result.first == result.second); } } diff --git a/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp index a92ad9692..381c2755a 100644 --- a/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp +++ b/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp index 23357e268..adf4a4727 100644 --- a/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp +++ b/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp index 3ffa3f22a..88b62a0b1 100644 --- a/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp +++ b/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/find0.pass.cpp b/test/std/containers/associative/map/map.ops/find0.pass.cpp index 76fe9242a..a11acb103 100644 --- a/test/std/containers/associative/map/map.ops/find0.pass.cpp +++ b/test/std/containers/associative/map/map.ops/find0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::map M; - M().find(C2Int{5}); + M example; + assert(example.find(C2Int{5}) == example.end()); } { typedef std::map M; - M().find(C2Int{5}); + M example; + assert(example.find(C2Int{5}) == example.end()); } } diff --git a/test/std/containers/associative/map/map.ops/find1.fail.cpp b/test/std/containers/associative/map/map.ops/find1.fail.cpp index 5346821b4..ca4ec4336 100644 --- a/test/std/containers/associative/map/map.ops/find1.fail.cpp +++ b/test/std/containers/associative/map/map.ops/find1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/find2.fail.cpp b/test/std/containers/associative/map/map.ops/find2.fail.cpp index 1dfb7fa44..cf8db60e8 100644 --- a/test/std/containers/associative/map/map.ops/find2.fail.cpp +++ b/test/std/containers/associative/map/map.ops/find2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/find3.fail.cpp b/test/std/containers/associative/map/map.ops/find3.fail.cpp index f5e92b826..79a4ae0d9 100644 --- a/test/std/containers/associative/map/map.ops/find3.fail.cpp +++ b/test/std/containers/associative/map/map.ops/find3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp b/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp index de7a545b6..2936da3cb 100644 --- a/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp +++ b/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::map M; - M().lower_bound(C2Int{5}); + M example; + assert(example.lower_bound(C2Int{5}) == example.end()); } { typedef std::map M; - M().lower_bound(C2Int{5}); + M example; + assert(example.lower_bound(C2Int{5}) == example.end()); } } diff --git a/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp index 6a3ed96a4..06468474f 100644 --- a/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp +++ b/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp index 87fffe7af..f60300712 100644 --- a/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp +++ b/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp index fbccd3ab2..40fb5ff5a 100644 --- a/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp +++ b/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp b/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp index 94508d284..fa97a7144 100644 --- a/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp +++ b/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::map M; - M().upper_bound(C2Int{5}); + M example; + assert(example.upper_bound(C2Int{5}) == example.end()); } { typedef std::map M; - M().upper_bound(C2Int{5}); + M example; + assert(example.upper_bound(C2Int{5}) == example.end()); } } diff --git a/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp index cb23588e2..2badd9957 100644 --- a/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp +++ b/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp index 1fa4cbc70..9a6e2be85 100644 --- a/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp +++ b/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp index 0f3cea238..f7a7dcd54 100644 --- a/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp +++ b/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp index 289d40573..db84dcf7b 100644 --- a/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp @@ -30,10 +30,10 @@ int main() { { typedef std::multimap M; - M().count(C2Int{5}); + assert(M().count(C2Int{5}) == 0); } { typedef std::multimap M; - M().count(C2Int{5}); + assert(M().count(C2Int{5}) == 0); } } diff --git a/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp index 70464b12c..bb15f67f9 100644 --- a/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp @@ -33,6 +33,6 @@ int main() { typedef std::multimap M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp index ad15ff441..779af3818 100644 --- a/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp @@ -33,6 +33,6 @@ int main() { typedef std::multimap M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp index 5e6c9ab6f..6fb1f4dfb 100644 --- a/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp @@ -33,6 +33,6 @@ int main() { typedef std::multimap M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp index 8cdd3c033..0c093898d 100644 --- a/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp @@ -30,10 +30,16 @@ int main() { { typedef std::multimap M; - M().equal_range(C2Int{5}); + typedef std::pair P; + M example; + P result = example.equal_range(C2Int{5}); + assert(result.first == result.second); } { typedef std::multimap M; - M().equal_range(C2Int{5}); + typedef std::pair P; + M example; + P result = example.equal_range(C2Int{5}); + assert(result.first == result.second); } } diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp index a339467f7..20c30fe40 100644 --- a/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp @@ -33,6 +33,6 @@ int main() { typedef std::multimap M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp index 633e0615b..a36fc1f54 100644 --- a/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp index 34b1b4b77..a2497761f 100644 --- a/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp index a06ec4d70..0cff61131 100644 --- a/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::multimap M; - M().find(C2Int{5}); + M example; + assert(example.find(C2Int{5}) == example.end()); } { typedef std::multimap M; - M().find(C2Int{5}); + M example; + assert(example.find(C2Int{5}) == example.end()); } } diff --git a/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp index bc3593292..3df826797 100644 --- a/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp index 254f524af..32435f98c 100644 --- a/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp index 2805f4759..011c61c54 100644 --- a/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp index 1000aa772..4a882af4e 100644 --- a/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::multimap M; - M().lower_bound(C2Int{5}); + M example; + assert(example.lower_bound(C2Int{5}) == example.end()); } { typedef std::multimap M; - M().lower_bound(C2Int{5}); + M example; + assert(example.lower_bound(C2Int{5}) == example.end()); } } diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp index 4b0db4787..df8cb3844 100644 --- a/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp index 300364cff..9c7fdcdcb 100644 --- a/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp index 09963096f..34eeddc01 100644 --- a/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp index 1a572e9c5..d7618141f 100644 --- a/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::multimap M; - M().upper_bound(C2Int{5}); + M example; + assert(example.upper_bound(C2Int{5}) == example.end()); } { typedef std::multimap M; - M().upper_bound(C2Int{5}); + M example; + assert(example.upper_bound(C2Int{5}) == example.end()); } } diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp index 10e59c5e5..67a26a213 100644 --- a/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp index 81ebbb832..35e79da51 100644 --- a/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp index fe4131524..eb3edb6a6 100644 --- a/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp +++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::multimap M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/test/std/iterators/iterators.general/gcc_workaround.pass.cpp b/test/std/iterators/iterators.general/gcc_workaround.pass.cpp index 6522bd3c7..28a5e95f3 100644 --- a/test/std/iterators/iterators.general/gcc_workaround.pass.cpp +++ b/test/std/iterators/iterators.general/gcc_workaround.pass.cpp @@ -11,10 +11,10 @@ #include -void f(const std::string &s) { s.begin(); } +void f(const std::string &s) { (void)s.begin(); } #include -void AppendTo(const std::vector &v) { v.begin(); } +void AppendTo(const std::vector &v) { (void)v.begin(); } int main() {} diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp index d2ad79af6..71b0eaca7 100644 --- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp +++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp @@ -43,8 +43,8 @@ int main() } { int a[] = {1,2,3,4}; - std::make_move_iterator(a+4); - std::make_move_iterator(a); // test for LWG issue 2061 + (void)std::make_move_iterator(a+4); + (void)std::make_move_iterator(a); // test for LWG issue 2061 } #if TEST_STD_VER > 14 diff --git a/test/std/strings/basic.string/string.access/at.pass.cpp b/test/std/strings/basic.string/string.access/at.pass.cpp index 891648930..8bfb829b0 100644 --- a/test/std/strings/basic.string/string.access/at.pass.cpp +++ b/test/std/strings/basic.string/string.access/at.pass.cpp @@ -35,7 +35,7 @@ test(S s, typename S::size_type pos) { try { - s.at(pos); + (void)s.at(pos); assert(false); } catch (std::out_of_range&) @@ -44,7 +44,7 @@ test(S s, typename S::size_type pos) } try { - cs.at(pos); + (void)cs.at(pos); assert(false); } catch (std::out_of_range&) diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp index bc2bf656d..6ca473f56 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp @@ -45,7 +45,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1, { try { - s.compare(pos1, n1, sv, pos2, n2); + (void)s.compare(pos1, n1, sv, pos2, n2); assert(false); } catch (const std::out_of_range&) @@ -69,7 +69,7 @@ test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1, { try { - s.compare(pos1, n1, sv, pos2); + (void)s.compare(pos1, n1, sv, pos2); assert(false); } catch (const std::out_of_range&) diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp index 13f6c5a1c..0f58fdcac 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp @@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1, { try { - s.compare(pos1, n1, str); + (void)s.compare(pos1, n1, str); assert(false); } catch (std::out_of_range&) diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp index fc811c846..5761b7513 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp @@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos, typename S::size_type n1, { try { - s.compare(pos, n1, str, n2); + (void)s.compare(pos, n1, str, n2); assert(false); } catch (std::out_of_range&) diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp index b3d7da29f..c543e7337 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp @@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1, { try { - s.compare(pos1, n1, str); + (void)s.compare(pos1, n1, str); assert(false); } catch (std::out_of_range&) diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp index 42bba9d5e..6e6381348 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp @@ -42,7 +42,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1, { try { - s.compare(pos1, n1, str, pos2, n2); + (void)s.compare(pos1, n1, str, pos2, n2); assert(false); } catch (const std::out_of_range&) @@ -65,7 +65,7 @@ test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1, { try { - s.compare(pos1, n1, str, pos2); + (void)s.compare(pos1, n1, str, pos2); assert(false); } catch (const std::out_of_range&) diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp index 6a5ba22cd..1e025c70e 100644 --- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp @@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1, { try { - s.compare(pos1, n1, sv); + (void)s.compare(pos1, n1, sv); assert(false); } catch (std::out_of_range&) diff --git a/test/std/strings/string.view/string.view.access/at.pass.cpp b/test/std/strings/string.view/string.view.access/at.pass.cpp index 6df879898..7d5cf241e 100644 --- a/test/std/strings/string.view/string.view.access/at.pass.cpp +++ b/test/std/strings/string.view/string.view.access/at.pass.cpp @@ -32,7 +32,7 @@ void test ( const CharT *s, size_t len ) { } #ifndef TEST_HAS_NO_EXCEPTIONS - try { sv.at(len); } catch ( const std::out_of_range & ) { return ; } + try { (void)sv.at(len); } catch ( const std::out_of_range & ) { return ; } assert ( false ); #endif } diff --git a/test/std/utilities/any/any.nonmembers/make_any.pass.cpp b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp index 5a4a3c3c1..d98b8d68b 100644 --- a/test/std/utilities/any/any.nonmembers/make_any.pass.cpp +++ b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp @@ -115,14 +115,14 @@ void test_make_any_throws() { { try { - std::make_any(101); + (void)std::make_any(101); assert(false); } catch (int const&) { } } { try { - std::make_any({1, 2, 3}, 101); + (void)std::make_any({1, 2, 3}, 101); assert(false); } catch (int const&) { } diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp index 117dd979f..73cf07336 100644 --- a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp +++ b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp @@ -126,7 +126,7 @@ int main() // test heterogeneous lookups std::set, std::owner_less<>> s; std::shared_ptr vp; - s.find(vp); + assert(s.find(vp) == s.end()); } #endif } diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp index 44e6e7305..bbc70014f 100644 --- a/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp +++ b/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp @@ -69,7 +69,7 @@ int main() optional opt; try { - opt.value(); + (void)opt.value(); assert(false); } catch (const bad_optional_access&) diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp index e2d48ec99..c644fb9d6 100644 --- a/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp +++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp @@ -61,7 +61,7 @@ int main() const optional opt; try { - opt.value(); + (void)opt.value(); assert(false); } catch (const bad_optional_access&) diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp index 874a5441a..5347d3f55 100644 --- a/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp +++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp @@ -61,7 +61,7 @@ int main() const optional opt; try { - std::move(opt).value(); + (void)std::move(opt).value(); assert(false); } catch (const bad_optional_access&) diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp index 60cab7d27..1a577e68b 100644 --- a/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp +++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp @@ -67,7 +67,7 @@ int main() optional opt; try { - std::move(opt).value(); + (void)std::move(opt).value(); assert(false); } catch (const bad_optional_access&) diff --git a/test/std/utilities/variant/variant.get/get_index.pass.cpp b/test/std/utilities/variant/variant.get/get_index.pass.cpp index 4f04f4a39..0ec65309d 100644 --- a/test/std/utilities/variant/variant.get/get_index.pass.cpp +++ b/test/std/utilities/variant/variant.get/get_index.pass.cpp @@ -259,7 +259,7 @@ void test_throws_for_all_value_categories() { auto test = [](auto idx, auto &&v) { using Idx = decltype(idx); try { - std::get(std::forward(v)); + (void)std::get(std::forward(v)); } catch (const std::bad_variant_access &) { return true; } catch (...) { /* ... */ diff --git a/test/std/utilities/variant/variant.get/get_type.pass.cpp b/test/std/utilities/variant/variant.get/get_type.pass.cpp index 63221f69c..5d9213ed0 100644 --- a/test/std/utilities/variant/variant.get/get_type.pass.cpp +++ b/test/std/utilities/variant/variant.get/get_type.pass.cpp @@ -259,7 +259,7 @@ void test_throws_for_all_value_categories() { auto test = [](auto idx, auto &&v) { using Idx = decltype(idx); try { - std::get(std::forward(v)); + (void)std::get(std::forward(v)); } catch (const std::bad_variant_access &) { return true; } catch (...) { /* ... */ -- cgit v1.2.3