mirror of
https://github.com/fmtlib/fmt.git
synced 2025-12-05 16:49:48 +01:00
Update clang-format to version 21
This commit is contained in:
6
.github/workflows/lint.yml
vendored
6
.github/workflows/lint.yml
vendored
@@ -18,11 +18,11 @@ jobs:
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
sudo bash ./llvm.sh 17
|
||||
sudo apt install clang-format-17
|
||||
sudo bash ./llvm.sh 21
|
||||
sudo apt install clang-format-21
|
||||
|
||||
- name: Run clang-format
|
||||
run: |
|
||||
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
|
||||
|
||||
@@ -1850,8 +1850,7 @@ template <typename T> class buffer {
|
||||
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1940
|
||||
FMT_CONSTEXPR20
|
||||
#endif
|
||||
void
|
||||
append(const U* begin, const U* end) {
|
||||
void append(const U* begin, const U* end) {
|
||||
while (begin != end) {
|
||||
auto size = size_;
|
||||
auto free_cap = capacity_ - size;
|
||||
|
||||
@@ -493,8 +493,8 @@ template <typename OutputIt,
|
||||
#if FMT_CLANG_VERSION >= 307 && !FMT_ICC_VERSION
|
||||
__attribute__((no_sanitize("undefined")))
|
||||
#endif
|
||||
FMT_CONSTEXPR20 inline auto
|
||||
reserve(OutputIt it, size_t n) -> typename OutputIt::value_type* {
|
||||
FMT_CONSTEXPR20 inline auto reserve(OutputIt it, size_t n) ->
|
||||
typename OutputIt::value_type* {
|
||||
auto& c = get_container(it);
|
||||
size_t size = c.size();
|
||||
c.resize(size + n);
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace detail {
|
||||
namespace {
|
||||
struct file_access_tag {};
|
||||
} // namespace
|
||||
template <typename Tag, typename BufType, FILE* BufType::*FileMemberPtr>
|
||||
template <typename Tag, typename BufType, FILE* BufType::* FileMemberPtr>
|
||||
class file_access {
|
||||
friend auto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user