diff --git a/.clang-tidy b/.clang-tidy index 376c3848..752ae48f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -38,6 +38,7 @@ Checks: > -modernize-use-override, -modernize-use-trailing-return-type, -modernize-use-using, + -readability-avoid-nested-conditional-operator, -readability-braces-around-statements, -readability-function-cognitive-complexity, -readability-function-size, @@ -45,9 +46,11 @@ Checks: > -readability-identifier-length, -readability-isolate-declaration, -readability-magic-numbers, + -readability-redundant-inline-specifier, -readability-simplify-boolean-expr, -readability-uppercase-literal-suffix, -performance-avoid-endl, + -performance-enum-size, -performance-inefficient-string-concatenation, -performance-no-automatic-move, -performance-noexcept-move-constructor diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index 2acd8d93..ea6ed37b 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -63,6 +63,7 @@ jobs: make clean make -j$(nproc) test selfcheck CXXFLAGS="-g3 -D_GLIBCXX_DEBUG" + # TODO: change it to -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG when the compiler is at least Clang 18 - name: Run with libc++ debug mode if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'clang++' run: | diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 4fb98b0f..a57f874b 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -21,19 +21,19 @@ jobs: run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 17 - sudo apt-get install clang-tidy-17 + sudo ./llvm.sh 18 + sudo apt-get install clang-tidy-18 - name: Verify clang-tidy configuration run: | - clang-tidy-17 --verify-config + clang-tidy-18 --verify-config - name: Prepare CMake run: | cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DDISABLE_CPP03_SYNTAX_CHECK=ON env: - CXX: clang-17 + CXX: clang-18 - name: Clang-Tidy run: | - run-clang-tidy-17 -q -j $(nproc) -p=cmake.output + run-clang-tidy-18 -q -j $(nproc) -p=cmake.output diff --git a/CMakeLists.txt b/CMakeLists.txt index 5954ac87..30ee1431 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-multichar -Wno-four-char-constants) # ignore C++11-specific warning add_compile_options(-Wno-suggest-override -Wno-suggest-destructor-override) + # contradicts -Wcovered-switch-default + add_compile_options(-Wno-switch-default) # TODO: fix these? add_compile_options(-Wno-padded -Wno-sign-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-shadow-field-in-constructor)