From e72e43af1c1531fb982954f868c4a45b72300023 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 1 Sep 2025 13:03:57 -0700 Subject: [PATCH] Apply clang-tidy --- test/compile-fp-test.cc | 3 ++- test/format-impl-test.cc | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/compile-fp-test.cc b/test/compile-fp-test.cc index 3afb7690..e1522c72 100644 --- a/test/compile-fp-test.cc +++ b/test/compile-fp-test.cc @@ -11,10 +11,11 @@ #if FMT_USE_CONSTEVAL template struct test_string { + Char buffer[max_string_length] = {}; + template constexpr bool operator==(const T& rhs) const noexcept { return fmt::basic_string_view(rhs).compare(buffer) == 0; } - Char buffer[max_string_length]{}; }; template diff --git a/test/format-impl-test.cc b/test/format-impl-test.cc index 2be15d00..3b0e07e3 100644 --- a/test/format-impl-test.cc +++ b/test/format-impl-test.cc @@ -292,7 +292,7 @@ struct double_double { auto format_as(double_double d) -> double { return d; } -bool operator>=(const double_double& lhs, const double_double& rhs) { +auto operator>=(const double_double& lhs, const double_double& rhs) -> bool { return lhs.a + lhs.b >= rhs.a + rhs.b; } @@ -356,11 +356,11 @@ TEST(format_impl_test, write_console_signature) { // A public domain branchless UTF-8 decoder by Christopher Wellons: // https://github.com/skeeto/branchless-utf8 -constexpr bool unicode_is_surrogate(uint32_t c) { +constexpr auto unicode_is_surrogate(uint32_t c) -> bool { return c >= 0xD800U && c <= 0xDFFFU; } -FMT_CONSTEXPR char* utf8_encode(char* s, uint32_t c) { +FMT_CONSTEXPR auto utf8_encode(char* s, uint32_t c) -> char* { if (c >= (1UL << 16)) { s[0] = static_cast(0xf0 | (c >> 18)); s[1] = static_cast(0x80 | ((c >> 12) & 0x3f));