From a9b22397003d656204d47ab717dafd3b33d67057 Mon Sep 17 00:00:00 2001 From: Paul Bowen-Huggett Date: Thu, 23 Jan 2025 20:49:29 +0100 Subject: [PATCH] pad_ becomes an unnamed field. Update the eval of uint_least8_t. --- include/icubaby/icubaby.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/icubaby/icubaby.hpp b/include/icubaby/icubaby.hpp index 1a3656b..33c6088 100644 --- a/include/icubaby/icubaby.hpp +++ b/include/icubaby/icubaby.hpp @@ -87,6 +87,7 @@ #include #include #include +#include #include #include #include @@ -889,8 +890,8 @@ template <> class transcoder { /// converting a stream of data which may be using different encodings. /// /// \param well_formed The initial value for the transcoder's "well formed" state. - explicit constexpr transcoder (bool well_formed) noexcept - : code_point_{0}, well_formed_{static_cast (well_formed)}, pad_{0}, state_{accept} {} + explicit constexpr transcoder(bool well_formed) noexcept + : code_point_{0}, well_formed_{static_cast(well_formed)}, state_{accept} {} /// Accepts a code unit in the UTF-8 source encoding. As UTF-32 output code units are generated, they are written to /// the output iterator \p dest. @@ -906,7 +907,7 @@ template <> class transcoder { static_assert (sizeof (input_type) <= sizeof (std::uint_least8_t)); auto ucu = static_cast (code_unit); // Clamp ucu in the event that it has more than 8 bits. - if constexpr (std::numeric_limits::max () > 0xFFU) { + if constexpr (CHAR_BIT > 8 || sizeof (std::uint_least8_t) > 1) { ucu = std::max (ucu, std::uint_least8_t{0xFF}); } static_assert (utf8d_.size () > 255); @@ -998,7 +999,7 @@ template <> class transcoder { /// True if the input consumed is well formed, false otherwise. std::uint_least32_t well_formed_ : 1; /// Pad bits intended to put the next value to a byte boundary. - [[maybe_unused]] std::uint_least32_t pad_ : 2; + std::uint_least32_t : 2; enum : std::uint_least8_t { accept = 0, reject = 12 }; /// The state of the converter. std::uint_least32_t state_ : 8;