diff --git a/include/papilio/detail/prefix.hpp b/include/papilio/detail/prefix.hpp index 429b62d..2730986 100644 --- a/include/papilio/detail/prefix.hpp +++ b/include/papilio/detail/prefix.hpp @@ -12,4 +12,5 @@ # pragma clang diagnostic ignored "-Wc++20-compat" # pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wcovered-switch-default" #endif diff --git a/include/papilio/format/fundamental.inl b/include/papilio/format/fundamental.inl index 7b60cd7..9216cc4 100644 --- a/include/papilio/format/fundamental.inl +++ b/include/papilio/format/fundamental.inl @@ -5,11 +5,6 @@ #include #include "helper.hpp" -#ifdef PAPILIO_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wcovered-switch-default" -#endif - namespace papilio { namespace detail @@ -44,7 +39,7 @@ namespace detail using context_t = format_context_traits; PAPILIO_ASSERT(m_data.fill != U'\0'); - context_t::append(ctx, utf::codepoint(m_data.fill), count); + context_t::append(ctx, m_data.fill, count); } }; @@ -469,6 +464,7 @@ namespace detail class string_formatter : public std_formatter_base { public: + using string_ref_type = utf::basic_string_ref; using string_container_type = utf::basic_string_container; void set_data(const std_formatter_data& data) @@ -483,15 +479,13 @@ namespace detail } template - auto format(string_container_type str, FormatContext& ctx) + auto format(string_ref_type str, FormatContext& ctx) { - PAPILIO_ASSERT(!str.has_ownership()); - using context_t = format_context_traits; - std::size_t used = 0; - + std::size_t used = 0; // Used width + // The "precision" for a string means the max width can be used. if(m_data.precision != 0) { for(auto it = str.begin(); it != str.end(); ++it) @@ -857,7 +851,3 @@ requires std::is_enum_v class formatter : public detail::enum_formatter {}; } // namespace papilio - -#ifdef PAPILIO_COMPILER_CLANG -# pragma clang diagnostic pop -#endif diff --git a/include/papilio/script/interpreter.hpp b/include/papilio/script/interpreter.hpp index 5f11cc7..89c808f 100644 --- a/include/papilio/script/interpreter.hpp +++ b/include/papilio/script/interpreter.hpp @@ -672,11 +672,6 @@ class basic_interpreter_base : public script_base static bool execute_op(op_id op, const variable_type& lhs, const variable_type& rhs) { -#ifdef PAPILIO_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wcovered-switch-default" -#endif - switch(op) { case op_id::equal: @@ -695,10 +690,6 @@ class basic_interpreter_base : public script_base default: PAPILIO_UNREACHABLE(); } - -#ifdef PAPILIO_COMPILER_CLANG -# pragma clang diagnostic pop -#endif } // Parses integer value diff --git a/include/papilio/utf/string.hpp b/include/papilio/utf/string.hpp index e299f1b..2d9d0fc 100644 --- a/include/papilio/utf/string.hpp +++ b/include/papilio/utf/string.hpp @@ -485,6 +485,12 @@ class basic_string_ref : public detail::str_implset_view(start, stop); + return *this; + } + using my_base::find; [[nodiscard]] @@ -661,6 +667,7 @@ class basic_string_ref : public detail::str_impl