Update clang-format to version 21

This commit is contained in:
Victor Zverovich
2025-11-28 19:28:17 -08:00
parent 2727215c11
commit 5bc56e24a9
6 changed files with 666 additions and 667 deletions

View File

@@ -18,11 +18,11 @@ jobs:
- name: Install clang-format - name: Install clang-format
run: | run: |
wget https://apt.llvm.org/llvm.sh wget https://apt.llvm.org/llvm.sh
sudo bash ./llvm.sh 17 sudo bash ./llvm.sh 21
sudo apt install clang-format-17 sudo apt install clang-format-21
- name: Run clang-format - name: Run clang-format
run: | run: |
find include src -name '*.h' -o -name '*.cc' | \ find include src -name '*.h' -o -name '*.cc' | \
xargs clang-format-17 -i -style=file -fallback-style=none xargs clang-format-21 -i -style=file -fallback-style=none
git diff --exit-code git diff --exit-code

View File

@@ -1850,8 +1850,7 @@ template <typename T> class buffer {
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1940 #if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1940
FMT_CONSTEXPR20 FMT_CONSTEXPR20
#endif #endif
void void append(const U* begin, const U* end) {
append(const U* begin, const U* end) {
while (begin != end) { while (begin != end) {
auto size = size_; auto size = size_;
auto free_cap = capacity_ - size; auto free_cap = capacity_ - size;

View File

@@ -155,7 +155,7 @@ enum class color : uint32_t {
white_smoke = 0xF5F5F5, // rgb(245,245,245) white_smoke = 0xF5F5F5, // rgb(245,245,245)
yellow = 0xFFFF00, // rgb(255,255,0) yellow = 0xFFFF00, // rgb(255,255,0)
yellow_green = 0x9ACD32 // rgb(154,205,50) yellow_green = 0x9ACD32 // rgb(154,205,50)
}; // enum class color }; // enum class color
enum class terminal_color : uint8_t { enum class terminal_color : uint8_t {
black = 30, black = 30,

File diff suppressed because it is too large Load Diff

View File

@@ -493,8 +493,8 @@ template <typename OutputIt,
#if FMT_CLANG_VERSION >= 307 && !FMT_ICC_VERSION #if FMT_CLANG_VERSION >= 307 && !FMT_ICC_VERSION
__attribute__((no_sanitize("undefined"))) __attribute__((no_sanitize("undefined")))
#endif #endif
FMT_CONSTEXPR20 inline auto FMT_CONSTEXPR20 inline auto reserve(OutputIt it, size_t n) ->
reserve(OutputIt it, size_t n) -> typename OutputIt::value_type* { typename OutputIt::value_type* {
auto& c = get_container(it); auto& c = get_container(it);
size_t size = c.size(); size_t size = c.size();
c.resize(size + n); c.resize(size + n);

View File

@@ -38,7 +38,7 @@ namespace detail {
namespace { namespace {
struct file_access_tag {}; struct file_access_tag {};
} // namespace } // namespace
template <typename Tag, typename BufType, FILE* BufType::*FileMemberPtr> template <typename Tag, typename BufType, FILE* BufType::* FileMemberPtr>
class file_access { class file_access {
friend auto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; } friend auto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; }
}; };