diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-04-03 18:13:08 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-04-03 18:13:08 +0000 |
commit | 1362d7ef885d1e8136e19d85c0eeba3477b53020 (patch) | |
tree | 20c29ea5d2e11b313daaff58043d72fa301dcf9a /lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py | |
parent | 956168c8029b4cc8c1d317f0326a7c1238101cb7 (diff) | |
download | bcm5719-llvm-1362d7ef885d1e8136e19d85c0eeba3477b53020.tar.gz bcm5719-llvm-1362d7ef885d1e8136e19d85c0eeba3477b53020.zip |
libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functions
This builds on the work done in r342808 and adds _LIBCPP_NODISCARD_EXT
to 37 more functions, namely:
adjacent_find, all_of, any_of, binary_search, clamp, count_if, count,
equal_range, equal, find_end, find_first_not_of, find_first_of, find_if,
find, includes, is_heap_until, is_heap, is_partitioned, is_permutation,
is_sorted_until, is_sorted, lexicographical_compare, lower_bound,
max_element, max, min_element, min, minmax_element, minmax, mismatch,
none_of, remove_if, remove, search_n, search, unique, upper_bound
The motivation here is that we noticed that find_if is nodiscard with
Visual Studio's standard library, and we deemed that useful
(https://crbug.com/948122).
https://devblogs.microsoft.com/cppblog/c17-progress-in-vs-2017-15-5-and-15-6/
says "Our criteria for emitting the warning are: discarding the return
value is a guaranteed leak [...], discarding the return value is
near-guaranteed to be incorrect (e.g. remove()/remove_if()/unique()), or
the function is essentially a pure observer (e.g. vector::empty() and
std::is_sorted())." so I went through algorithm and tried to apply these
criteria.
Some of these, like vector::empty() are already nodiscard per C++
standard and didn't need changing.
I didn't (yet?) go over std::string::find* methods which should probably
have _LIBCPP_NODISCARD_EXT too (but not as part of this change).
Differential Revision: https://reviews.llvm.org/D60145
llvm-svn: 357619
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py')
0 files changed, 0 insertions, 0 deletions