diff options
| author | Augie Fackler <augie@google.com> | 2025-03-05 13:52:31 -0500 |
|---|---|---|
| committer | Augie Fackler <augie@google.com> | 2025-03-05 16:42:40 -0500 |
| commit | da61b0ddc5dcc8f1ac64eaddabdbfec5aa23f22b (patch) | |
| tree | 8750d4c36c31e7d3babb229377b1c521dc9d21d7 /libc/src/__support/CPP/span.h | |
| parent | 46236f4c3dbe11e14fe7ac1f4b903637efedfecf (diff) | |
Revert "[libc] Enable -Wconversion for tests. (#127523)"
This reverts commit 1e6e845d49a336e9da7ca6c576ec45c0b419b5f6 because it
changed the 1st parameter of adjust() to be unsigned, but libc itself
calls adjust() with a negative argument in align_backward() in
op_generic.h.
Diffstat (limited to 'libc/src/__support/CPP/span.h')
| -rw-r--r-- | libc/src/__support/CPP/span.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libc/src/__support/CPP/span.h b/libc/src/__support/CPP/span.h index 9234a26d201c..a41c9b744e37 100644 --- a/libc/src/__support/CPP/span.h +++ b/libc/src/__support/CPP/span.h @@ -11,7 +11,6 @@ #include <stddef.h> // For size_t #include "array.h" // For array -#include "limits.h" #include "src/__support/macros/config.h" #include "type_traits.h" // For remove_cv_t, enable_if_t, is_same_v, is_const_v @@ -49,8 +48,7 @@ public: using const_reference = const T &; using iterator = T *; - LIBC_INLINE_VAR static constexpr size_type dynamic_extent = - cpp::numeric_limits<size_type>::max(); + LIBC_INLINE_VAR static constexpr size_type dynamic_extent = -1; LIBC_INLINE constexpr span() : span_data(nullptr), span_size(0) {} @@ -60,7 +58,7 @@ public: : span_data(first), span_size(count) {} LIBC_INLINE constexpr span(pointer first, pointer end) - : span_data(first), span_size(static_cast<size_t>(end - first)) {} + : span_data(first), span_size(end - first) {} template <typename U, size_t N, cpp::enable_if_t<is_compatible_v<U>, bool> = true> |
