llvm-capstone/libcxx/include
Nico Weber 1362d7ef88 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
2019-04-03 18:13:08 +00:00
..
experimental Revert "[coroutines] Add std::experimental::task<T> type" 2019-03-26 19:50:46 +00:00
ext Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
support [libc++] Remove empty header xlocale/xlocale.h 2019-03-11 15:41:51 +00:00
__bit_reference Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__bsd_locale_defaults.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__bsd_locale_fallbacks.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__config Fix PR#35967: '<regex> syntax_option_type is not a proper bitmask' Sadly, this is an ABI break, so it's only available if you define either '_LIBCPP_ABI_VERSION > 2' or '_LIBCPP_ABI_UNSTABLE' or '_LIBCPP_ABI_REGEX_CONSTANTS_NONZERO' and rebuild your dylib. 2019-03-28 17:30:23 +00:00
__config_site.in Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__debug Remove exception throwing debug mode handler support. 2019-03-18 21:50:12 +00:00
__errc Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__functional_03 Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__functional_base Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__functional_base_03 Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__hash_table Remove exception throwing debug mode handler support. 2019-03-18 21:50:12 +00:00
__libcpp_version Bump the trunk version to 9.0.0svn 2019-01-16 10:57:02 +00:00
__locale Fix and speedup __libcpp_locale_guard on Windows 2019-03-27 18:09:30 +00:00
__mutex_base Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__node_handle [libc++] Remove visibility-related warnings with Clang 8 2019-02-27 17:33:25 +00:00
__nullptr Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__split_buffer [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
__sso_allocator Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__std_stream Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__string Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
__threading_support Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
__tree Apply D28248: 'Work around GCC PR37804'. Thanks to mdaniels for the patch 2019-01-23 23:06:18 +00:00
__tuple [libc++] Declare std::tuple_element as struct instead of class 2019-04-01 16:39:34 +00:00
__undef_macros Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
algorithm libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functions 2019-04-03 18:13:08 +00:00
any Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
array [libc++] Declare std::tuple_element as struct instead of class 2019-04-01 16:39:34 +00:00
atomic Fix C++03 build failure 2019-03-08 23:30:26 +00:00
bit Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
bitset Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cassert Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ccomplex Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cctype Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cerrno Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cfenv Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cfloat Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
charconv Make to_chars/from_chars work back to C++11. This means that we can use them to implement to_string as well. Reviewed as https://reviews.llvm.org/D59598. 2019-03-20 18:13:23 +00:00
chrono Fix PR41130 - 'operator/ of std::chrono::duration and custom type'. Thanks to Zulan for the report, and Howard for the direction of the fix. 2019-04-01 16:38:02 +00:00
cinttypes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ciso646 Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
climits Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
clocale Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
CMakeLists.txt Revert "[coroutines] Add std::experimental::task<T> type" 2019-03-26 19:50:46 +00:00
cmath Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
codecvt Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
compare Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
complex Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
complex.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
condition_variable Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
csetjmp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
csignal Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdarg Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdbool Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstddef Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdint Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdio Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstdlib Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cstring Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ctgmath Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ctime Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ctype.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cwchar Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
cwctype Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
deque Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These are just rebranded 'operator[]', and should be noexcept like it is. 2019-03-19 03:30:07 +00:00
errno.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
exception Make VCRuntime ABI configuration a first-class option. 2019-03-05 01:57:01 +00:00
fenv.h Mark fenv.h as a system header before the #include_next directive 2019-03-29 16:03:57 +00:00
filesystem [libc++] Mark <filesystem> as unavailable on Apple platforms using pragmas 2019-03-20 21:18:14 +00:00
float.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
forward_list Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
fstream [libc++] Mark <filesystem> tests as failing when the dylib doesn't support filesystem 2019-03-20 14:34:00 +00:00
functional [libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807 2019-04-03 17:54:37 +00:00
future Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
initializer_list Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
inttypes.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
iomanip Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ios Revert "[libc++] Fix error flags and exceptions propagated from input stream operations" 2019-04-02 22:21:27 +00:00
iosfwd Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
iostream Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
istream Revert "[libc++] Fix error flags and exceptions propagated from input stream operations" 2019-04-02 22:21:27 +00:00
iterator Fix a minor bug with std::next and prev not and negative numbers. In particular, std::prev cannot require Bidirectional Iterators, because you might 'go back' -1 places, which goes forward. Thanks to Ville and Jonathan for the bug report. 2019-03-22 22:32:20 +00:00
limits Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
limits.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
list Remove exception throwing debug mode handler support. 2019-03-18 21:50:12 +00:00
locale add a test and a couple minor bug fixes for the implicit-signed-integer-truncation sanitizer. This is PR#40566 2019-02-01 21:59:27 +00:00
locale.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
map [libc++] Avoid UB in the no-exceptions mode in a few places 2019-02-12 16:06:02 +00:00
math.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
memory Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
module.modulemap Revert "[coroutines] Add std::experimental::task<T> type" 2019-03-26 19:50:46 +00:00
mutex libc++/win: Make once_flag have the same size as a pointer. 2019-03-20 22:55:03 +00:00
new Make VCRuntime ABI configuration a first-class option. 2019-03-05 01:57:01 +00:00
numeric Add std::midpoint for integral and poiner types. Described in P0811, reviewed as D59099. 2019-03-14 16:25:55 +00:00
optional Cleaup of requirements for optional. While researching LWG3196, I realized that optional did not reject 'const in_place_t' like it should. Added a test as well, and a check for arrays (which were already disallowed, but now we get a better error message). Should not affect anyone's code. 2019-03-25 16:35:59 +00:00
ostream Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
queue Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
random Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ratio Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
regex Fix PR#35967: '<regex> syntax_option_type is not a proper bitmask' Sadly, this is an ABI break, so it's only available if you define either '_LIBCPP_ABI_VERSION > 2' or '_LIBCPP_ABI_UNSTABLE' or '_LIBCPP_ABI_REGEX_CONSTANTS_NONZERO' and rebuild your dylib. 2019-03-28 17:30:23 +00:00
scoped_allocator Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
set Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
setjmp.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
shared_mutex Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
span [libc++] Declare std::tuple_element as struct instead of class 2019-04-01 16:39:34 +00:00
sstream add a test and a couple minor bug fixes for the implicit-signed-integer-truncation sanitizer. This is PR#40566 2019-02-01 21:59:27 +00:00
stack Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stdbool.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stddef.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stdexcept Fix ABI compatibility of <stdexcept> with VCRuntime. 2019-03-06 20:31:57 +00:00
stdint.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
stdio.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
stdlib.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
streambuf Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
string Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These are just rebranded 'operator[]', and should be noexcept like it is. 2019-03-19 03:30:07 +00:00
string_view Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These are just rebranded 'operator[]', and should be noexcept like it is. 2019-03-19 03:30:07 +00:00
string.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
strstream Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
system_error Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
tgmath.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
thread Fix backwards test that I committed yesterday. Sigh 2019-04-03 00:01:03 +00:00
tuple [libc++] Declare std::tuple_element as struct instead of class 2019-04-01 16:39:34 +00:00
type_traits [libc++] (Take 2) Correctly handle Objective-C++ ARC qualifiers in std::is_pointer 2019-04-03 14:29:52 +00:00
typeindex Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
typeinfo Make VCRuntime ABI configuration a first-class option. 2019-03-05 01:57:01 +00:00
unordered_map [libc++] Avoid UB in the no-exceptions mode in a few places 2019-02-12 16:06:02 +00:00
unordered_set Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
utility [libc++] Declare std::tuple_element as struct instead of class 2019-04-01 16:39:34 +00:00
valarray Fix a number of bugs in __val_expr's subset operator[]. 2019-04-02 08:05:23 +00:00
variant Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
vector Add visibility attributes and inline to some vector methods. 2019-03-19 19:19:44 +00:00
version Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
wchar.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
wctype.h Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00