The definition of is_nothrow_invocable in terms of is_convertible and is_nothrow_constructible is incorrect, because a type could have an explicit constructor that means is_nothrow_constructible is true, but implicit conversions could use a different constructor that is potentially-throwing. Fix it by adding a C++11 version of C++20's is_nothrow_convertible that only considers implicit conversions. * include/std/type_traits (__is_nt_convertible_helper): Define it unconditionally, not only for C++20. (__is_nothrow_convertible): Define internal trait for use in C++11. (__is_nt_invocable_impl: Fix by using __is_nothrow_convertible. (is_invocable_r_v, is_nothrow_invocable_r_v): Add missing parameter. * testsuite/20_util/is_nothrow_convertible/value_ext.cc: New test. * testsuite/20_util/is_nothrow_convertible/value.cc: Check with type that has nothrow explicit conversion but potentially-throwing implicit conversion. * testsuite/20_util/is_nothrow_invocable/value.cc: Likewise. * testsuite/20_util/is_nothrow_invocable/value_ext.cc: Fix helper function to only consider implicit conversions. * testsuite/20_util/tuple/cons/noexcept_specs.cc: Add comment. From-SVN: r271171
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
apply | Loading commit data... | |
comparison_operators | Loading commit data... | |
cons | Loading commit data... | |
creation_functions | Loading commit data... | |
element_access | Loading commit data... | |
make_from_tuple | Loading commit data... | |
requirements | Loading commit data... | |
48476.cc | Loading commit data... | |
51365.cc | Loading commit data... | |
53648.cc | Loading commit data... | |
56785.cc | Loading commit data... | |
60497.cc | Loading commit data... | |
61947.cc | Loading commit data... | |
67844.cc | Loading commit data... | |
77395.cc | Loading commit data... | |
77802.cc | Loading commit data... | |
78939.cc | Loading commit data... | |
cv_tuple_element.cc | Loading commit data... | |
cv_tuple_size.cc | Loading commit data... | |
cv_tuple_size_neg.cc | Loading commit data... | |
dr2729.cc | Loading commit data... | |
moveable.cc | Loading commit data... | |
moveable2.cc | Loading commit data... | |
noexcept_move_assign.cc | Loading commit data... | |
noexcept_swap.cc | Loading commit data... | |
swap.cc | Loading commit data... | |
swap_cxx17.cc | Loading commit data... | |
tuple_element.cc | Loading commit data... | |
tuple_element_t.cc | Loading commit data... | |
tuple_size.cc | Loading commit data... | |
tuple_size_v.cc | Loading commit data... |