From 97d7b79e0a6fc584495799f2354c39b7ad8a6568 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 17 Jan 2025 18:32:41 -0800 Subject: [PATCH 1/2] Update clang-tidy from Clang 11 to Clang 18 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fe7d1c7d..afd12b69c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,9 +172,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install clang-tidy - run: sudo apt-get install clang-tidy-11 + run: sudo apt-get install clang-tidy-18 - name: Run clang-tidy - run: clang-tidy-11 src/cxx.cc --warnings-as-errors=* + run: clang-tidy-18 src/cxx.cc --warnings-as-errors=* outdated: name: Outdated From a75dadff80b2a051e7d79d3c6984ddfc30138d65 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 17 Jan 2025 18:32:49 -0800 Subject: [PATCH 2/2] Suppress new clang-tidy checks $ clang-tidy-18 src/cxx.cc --warnings-as-errors=* 2482 warnings generated. /git/cxx/src/cxx.cc:205:10: error: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list,-warnings-as-errors] 205 | return std::string(this->data(), this->size()); | ^ /git/cxx/src/cxx.cc:318:10: error: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list,-warnings-as-errors] 318 | return std::string(this->data(), this->size()); | ^ /git/cxx/src/cxx.cc:542:17: error: member 'throw$' of type 'repr::PtrLen &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors] 542 | repr::PtrLen &throw$; | ^ Suppressed 2479 warnings (2479 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings treated as errors --- .clang-tidy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index b0a6da98b..671d53928 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,6 +3,7 @@ Checks: clang-diagnostic-*, cppcoreguidelines-*, modernize-*, + -cppcoreguidelines-avoid-const-or-ref-data-members, -cppcoreguidelines-macro-usage, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, @@ -12,6 +13,7 @@ Checks: -cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-special-member-functions, + -modernize-return-braced-init-list, -modernize-use-default-member-init, -modernize-use-equals-default, -modernize-use-trailing-return-type,