Skip to content

Commit

Permalink
Merge branch 'fmtlib:master' into zig-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane authored Feb 27, 2024
2 parents c722eb5 + f68f452 commit 2ed0fd0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2631,6 +2631,7 @@ template <typename T> struct strip_named_arg<T, true> {
};

template <typename T, typename ParseContext>
FMT_VISIBILITY("hidden") // Suppress an ld warning on macOS (#3769).
FMT_CONSTEXPR auto parse_format_specs(ParseContext& ctx)
-> decltype(ctx.begin()) {
using char_type = typename ParseContext::char_type;
Expand Down
5 changes: 3 additions & 2 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc)
if (detail::is_utf8() && loc != get_classic_locale()) {
// char16_t and char32_t codecvts are broken in MSVC (linkage errors) and
// gcc-4.
#if FMT_MSC_VERSION != 0 || \
(defined(__GLIBCXX__) && !defined(_GLIBCXX_USE_DUAL_ABI))
#if FMT_MSC_VERSION != 0 || \
(defined(__GLIBCXX__) && \
(!defined(_GLIBCXX_USE_DUAL_ABI) || _GLIBCXX_USE_DUAL_ABI == 0))
// The _GLIBCXX_USE_DUAL_ABI macro is always defined in libstdc++ from gcc-5
// and newer.
using code_unit = wchar_t;
Expand Down
4 changes: 2 additions & 2 deletions include/fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace detail {
// signed and unsigned integers.
template <bool IsSigned> struct int_checker {
template <typename T> static auto fits_in_int(T value) -> bool {
unsigned max = max_value<int>();
unsigned max = to_unsigned(max_value<int>());
return value <= max;
}
static auto fits_in_int(bool) -> bool { return true; }
Expand Down Expand Up @@ -205,7 +205,7 @@ class printf_width_handler {
specs_.align = align::left;
width = 0 - width;
}
unsigned int_max = max_value<int>();
unsigned int_max = to_unsigned(max_value<int>());
if (width > int_max) report_error("number is too big");
return static_cast<unsigned>(width);
}
Expand Down
6 changes: 3 additions & 3 deletions include/fmt/std.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ FMT_BEGIN_NAMESPACE

FMT_EXPORT
template <typename T, typename E, typename Char>
struct formatter<
std::expected<T, E>, Char,
std::enable_if_t<is_formattable<T, Char> && is_formattable<E, Char>>> {
struct formatter<std::expected<T, E>, Char,
std::enable_if_t<is_formattable<T, Char>::value &&
is_formattable<E, Char>::value>> {
template <typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
return ctx.begin();
Expand Down

0 comments on commit 2ed0fd0

Please sign in to comment.