diff options
| author | Billy Robert O'Neal III <bion@microsoft.com> | 2017-11-15 07:40:37 +0000 |
|---|---|---|
| committer | Billy Robert O'Neal III <bion@microsoft.com> | 2017-11-15 07:40:37 +0000 |
| commit | 83252766f906799d68a46af39687d7a60fa8530a (patch) | |
| tree | c0885eb31dc65c8eccea6e06f5cad5d7fbf070ab /libcxx/test/std/containers/associative/map | |
| parent | ad51924eb4aec3f28a2f1a20b8b9040bfd4d3052 (diff) | |
| download | bcm5719-llvm-83252766f906799d68a46af39687d7a60fa8530a.tar.gz bcm5719-llvm-83252766f906799d68a46af39687d7a60fa8530a.zip | |
Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033
llvm-svn: 318276
Diffstat (limited to 'libcxx/test/std/containers/associative/map')
20 files changed, 37 insertions, 25 deletions
diff --git a/libcxx/test/std/containers/associative/map/map.ops/count0.pass.cpp b/libcxx/test/std/containers/associative/map/map.ops/count0.pass.cpp index 1fa8c4a70bd..5649c57f25b 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/count0.pass.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/count0.pass.cpp @@ -30,10 +30,10 @@ int main() { { typedef std::map<int, double, transparent_less> M; - M().count(C2Int{5}); + assert(M().count(C2Int{5}) == 0); } { typedef std::map<int, double, transparent_less_not_referenceable> M; - M().count(C2Int{5}); + assert(M().count(C2Int{5}) == 0); } } diff --git a/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp index bd0bf2ec4a0..5ad176142cf 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_no_type> M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp index ff4bed8cb60..bb1c32e0e48 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_private> M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp index 55a463ed38a..8964384de52 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_not_a_type> M; - M().count(C2Int{5}); + (void)M().count(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp b/libcxx/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp index c254fb6a7db..310db6d8937 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp @@ -30,10 +30,16 @@ int main() { { typedef std::map<int, double, transparent_less> M; - M().equal_range(C2Int{5}); + typedef std::pair<typename M::iterator, typename M::iterator> P; + M example; + P result = example.equal_range(C2Int{5}); + assert(result.first == result.second); } { typedef std::map<int, double, transparent_less_not_referenceable> M; - M().equal_range(C2Int{5}); + typedef std::pair<typename M::iterator, typename M::iterator> P; + M example; + P result = example.equal_range(C2Int{5}); + assert(result.first == result.second); } } diff --git a/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp index a92ad96921c..381c2755a08 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_no_type> M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp index 23357e26897..adf4a4727c2 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_private> M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp index 3ffa3f22a61..88b62a0b16d 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_not_a_type> M; - M().equal_range(C2Int{5}); + (void)M().equal_range(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/find0.pass.cpp b/libcxx/test/std/containers/associative/map/map.ops/find0.pass.cpp index 76fe9242a47..a11acb10374 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/find0.pass.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/find0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::map<int, double, transparent_less> M; - M().find(C2Int{5}); + M example; + assert(example.find(C2Int{5}) == example.end()); } { typedef std::map<int, double, transparent_less_not_referenceable> M; - M().find(C2Int{5}); + M example; + assert(example.find(C2Int{5}) == example.end()); } } diff --git a/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp index 5346821b42a..ca4ec43361a 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_no_type> M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp index 1dfb7fa44b0..cf8db60e8f3 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_private> M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp index f5e92b8264b..79a4ae0d9ca 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_not_a_type> M; - M().find(C2Int{5}); + (void)M().find(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp index de7a545b649..2936da3cb44 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::map<int, double, transparent_less> M; - M().lower_bound(C2Int{5}); + M example; + assert(example.lower_bound(C2Int{5}) == example.end()); } { typedef std::map<int, double, transparent_less_not_referenceable> M; - M().lower_bound(C2Int{5}); + M example; + assert(example.lower_bound(C2Int{5}) == example.end()); } } diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp index 6a3ed96a4fc..06468474fd4 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_no_type> M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp index 87fffe7afcc..f6030071283 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_private> M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp index fbccd3ab221..40fb5ff5a24 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_not_a_type> M; - M().lower_bound(C2Int{5}); + (void)M().lower_bound(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp b/libcxx/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp index 94508d284fd..fa97a714486 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp @@ -30,10 +30,12 @@ int main() { { typedef std::map<int, double, transparent_less> M; - M().upper_bound(C2Int{5}); + M example; + assert(example.upper_bound(C2Int{5}) == example.end()); } { typedef std::map<int, double, transparent_less_not_referenceable> M; - M().upper_bound(C2Int{5}); + M example; + assert(example.upper_bound(C2Int{5}) == example.end()); } } diff --git a/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp index cb23588e2b9..2badd9957b1 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_no_type> M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp index 1fa4cbc7001..9a6e2be850a 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_private> M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif diff --git a/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp index 0f3cea23829..f7a7dcd540e 100644 --- a/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp +++ b/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp @@ -34,7 +34,7 @@ int main() { typedef std::map<int, double, transparent_less_not_a_type> M; - M().upper_bound(C2Int{5}); + (void)M().upper_bound(C2Int{5}); } } #endif |

