Skip to content

Commit cc436df

Browse files
committed
Address feedback
1 parent 24d8122 commit cc436df

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

libcxx/include/__charconv/to_chars_base_10.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline __uint128_t __pow_10(
139139
_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
140140
__base_10_u128(char* __buffer, __uint128_t __value) noexcept {
141141
_LIBCPP_ASSERT_INTERNAL(
142-
__value > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
142+
__value > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fails when this isn't true.");
143143

144144
// Unlike the 64 to 32 bit case the 128 bit case the "upper half" can't be
145145
// stored in the "lower half". Instead we first need to handle the top most

libcxx/include/__chrono/parser_std_format_spec.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,9 @@ class _LIBCPP_TEMPLATE_VIS __parser_chrono {
160160
private:
161161
_LIBCPP_HIDE_FROM_ABI constexpr _ConstIterator
162162
__parse_chrono_specs(_ConstIterator __begin, _ConstIterator __end, __flags __flags) {
163-
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
164-
__begin != __end,
165-
"When called with an empty input the function will cause "
166-
"undefined behavior by evaluating data not in the input");
163+
_LIBCPP_ASSERT_INTERNAL(__begin != __end,
164+
"When called with an empty input the function will cause "
165+
"undefined behavior by evaluating data not in the input");
167166

168167
if (*__begin != _CharT('%') && *__begin != _CharT('}'))
169168
std::__throw_format_error("The format specifier expects a '%' or a '}'");

libcxx/include/__iterator/advance.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ template < class _InputIter,
6565
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void advance(_InputIter& __i, _Distance __orig_n) {
6666
typedef typename iterator_traits<_InputIter>::difference_type _Difference;
6767
_Difference __n = static_cast<_Difference>(std::__convert_to_integral(__orig_n));
68-
// Calling `advance` with a negative value on a non-bidirectional iterator in the current implementation.
68+
// Calling `advance` with a negative value on a non-bidirectional iterator is a no-op in the current implementation.
6969
_LIBCPP_ASSERT_PEDANTIC(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
7070
"Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
7171
std::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
@@ -100,7 +100,7 @@ struct __fn {
100100
// Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative.
101101
template <input_or_output_iterator _Ip>
102102
_LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const {
103-
// Calling `advance` with a negative value on a non-bidirectional iterator in the current implementation.
103+
// Calling `advance` with a negative value on a non-bidirectional iterator is a no-op in the current implementation.
104104
_LIBCPP_ASSERT_PEDANTIC(
105105
__n >= 0 || bidirectional_iterator<_Ip>, "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
106106

@@ -151,7 +151,7 @@ struct __fn {
151151
template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
152152
_LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip>
153153
operator()(_Ip& __i, iter_difference_t<_Ip> __n, _Sp __bound_sentinel) const {
154-
// Calling `advance` with a negative value on a non-bidirectional iterator in the current implementation.
154+
// Calling `advance` with a negative value on a non-bidirectional iterator is a no-op in the current implementation.
155155
_LIBCPP_ASSERT_PEDANTIC((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
156156
"If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
157157
// If `S` and `I` model `sized_sentinel_for<S, I>`:

libcxx/include/__ranges/chunk_by_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class _LIBCPP_ABI_2023_OVERLAPPING_SUBOBJECT_FIX_TAG chunk_by_view
7979
_LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_View> __find_prev(iterator_t<_View> __current)
8080
requires bidirectional_range<_View>
8181
{
82-
// Attempting to increment an end iterator is a no-op (`__find_next` would return the same argument given to it).
82+
// Attempting to decrement a begin iterator is a no-op (`__find_prev` would return the same argument given to it).
8383
_LIBCPP_ASSERT_PEDANTIC(__current != ranges::begin(__base_), "Trying to call __find_prev() on a begin iterator.");
8484
// Note: this duplicates a check in `optional` but provides a better error message.
8585
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(

libcxx/include/print

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __encode(_OutIt&, char32_t) = delete;
122122
template <class _OutIt>
123123
requires __utf16_code_unit<iter_value_t<_OutIt>>
124124
_LIBCPP_HIDE_FROM_ABI constexpr void __encode(_OutIt& __out_it, char32_t __value) {
125-
// From the Standard: "if `out` contains invalid code units, the behavior is undefined and implementations are
126-
// encouraged to diagnose it".
125+
// [print.fun]/7 : "if `out` contains invalid code units, the behavior is undefined and implementations are encouraged
126+
// to diagnose it".
127127
_LIBCPP_ASSERT_UNCATEGORIZED(__is_scalar_value(__value), "an invalid unicode scalar value results in invalid UTF-16");
128128

129129
if (__value < 0x10000) {
@@ -139,8 +139,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __encode(_OutIt& __out_it, char32_t __value
139139
template <class _OutIt>
140140
requires __utf32_code_unit<iter_value_t<_OutIt>>
141141
_LIBCPP_HIDE_FROM_ABI constexpr void __encode(_OutIt& __out_it, char32_t __value) {
142-
// From the Standard: "if `out` contains invalid code units, the behavior is undefined and implementations are
143-
// encouraged to diagnose it".
142+
// [print.fun]/7 : "if `out` contains invalid code units, the behavior is undefined and implementations are encouraged
143+
// to diagnose it".
144144
_LIBCPP_ASSERT_UNCATEGORIZED(__is_scalar_value(__value), "an invalid unicode scalar value results in invalid UTF-32");
145145
*__out_it++ = __value;
146146
}

0 commit comments

Comments
 (0)