Skip to content

Commit 6547bf7

Browse files
authored
clang-tidy.yml: updated to Clang 18 (#307)
* clang-tidy.yml: updated to Clang 18 * .clang-tidy: disabled `performance-enum-size` clang-tidy check * disabled `-Wswitch-default` Clang compiler warning * .clang-tidy: disabled `readability-redundant-inline-specifier` clang-tidy check * .clang-tidy: disabled `readability-avoid-nested-conditional-operator` clang-tidy check for now * CI-unixish.yml: added TODO about updated libc++ hardening mode
1 parent 03dee1b commit 6547bf7

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

.clang-tidy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,19 @@ Checks: >
3838
-modernize-use-override,
3939
-modernize-use-trailing-return-type,
4040
-modernize-use-using,
41+
-readability-avoid-nested-conditional-operator,
4142
-readability-braces-around-statements,
4243
-readability-function-cognitive-complexity,
4344
-readability-function-size,
4445
-readability-implicit-bool-conversion,
4546
-readability-identifier-length,
4647
-readability-isolate-declaration,
4748
-readability-magic-numbers,
49+
-readability-redundant-inline-specifier,
4850
-readability-simplify-boolean-expr,
4951
-readability-uppercase-literal-suffix,
5052
-performance-avoid-endl,
53+
-performance-enum-size,
5154
-performance-inefficient-string-concatenation,
5255
-performance-no-automatic-move,
5356
-performance-noexcept-move-constructor

.github/workflows/CI-unixish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
make clean
6464
make -j$(nproc) test selfcheck CXXFLAGS="-g3 -D_GLIBCXX_DEBUG"
6565
66+
# TODO: change it to -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG when the compiler is at least Clang 18
6667
- name: Run with libc++ debug mode
6768
if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'clang++'
6869
run: |

.github/workflows/clang-tidy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ jobs:
2121
run: |
2222
wget https://apt.llvm.org/llvm.sh
2323
chmod +x llvm.sh
24-
sudo ./llvm.sh 17
25-
sudo apt-get install clang-tidy-17
24+
sudo ./llvm.sh 18
25+
sudo apt-get install clang-tidy-18
2626
2727
- name: Verify clang-tidy configuration
2828
run: |
29-
clang-tidy-17 --verify-config
29+
clang-tidy-18 --verify-config
3030
3131
- name: Prepare CMake
3232
run: |
3333
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DDISABLE_CPP03_SYNTAX_CHECK=ON
3434
env:
35-
CXX: clang-17
35+
CXX: clang-18
3636

3737
- name: Clang-Tidy
3838
run: |
39-
run-clang-tidy-17 -q -j $(nproc) -p=cmake.output
39+
run-clang-tidy-18 -q -j $(nproc) -p=cmake.output

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
2828
add_compile_options(-Wno-multichar -Wno-four-char-constants)
2929
# ignore C++11-specific warning
3030
add_compile_options(-Wno-suggest-override -Wno-suggest-destructor-override)
31+
# contradicts -Wcovered-switch-default
32+
add_compile_options(-Wno-switch-default)
3133
# TODO: fix these?
3234
add_compile_options(-Wno-padded -Wno-sign-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-shadow-field-in-constructor)
3335

0 commit comments

Comments
 (0)