Skip to content

Commit 367847c

Browse files
authored
updated CI to Clang 16 (#4641)
1 parent 33a03f2 commit 367847c

8 files changed

Lines changed: 33 additions & 21 deletions

File tree

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics'
2+
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics,-misc-use-anonymous-namespace'
33
WarningsAsErrors: '*'
44
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
55
CheckOptions:

.github/workflows/asan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ jobs:
3333
run: |
3434
wget https://apt.llvm.org/llvm.sh
3535
chmod +x llvm.sh
36-
sudo ./llvm.sh 15
36+
sudo ./llvm.sh 16
3737
3838
- name: CMake
3939
run: |
4040
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
4141
env:
42-
CC: clang-15
43-
CXX: clang++-15
42+
CC: clang-16
43+
CXX: clang++-16
4444

4545
- name: Build cppcheck
4646
run: |

.github/workflows/clang-tidy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
run: |
3030
wget https://apt.llvm.org/llvm.sh
3131
chmod +x llvm.sh
32-
sudo ./llvm.sh 15
33-
sudo apt-get install -y clang-tidy-15
32+
sudo ./llvm.sh 16
33+
sudo apt-get install -y clang-tidy-16
3434
3535
- name: Install Qt ${{ env.QT_VERSION }}
3636
uses: jurplel/install-qt-action@v3
@@ -41,14 +41,14 @@ jobs:
4141

4242
- name: Verify clang-tidy configuration
4343
run: |
44-
clang-tidy-15 --verify-config
44+
clang-tidy-16 --verify-config
4545
4646
- name: Prepare CMake
4747
run: |
4848
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off
4949
env:
50-
CC: clang-15
51-
CXX: clang++-15
50+
CC: clang-16
51+
CXX: clang++-16
5252

5353
- name: Prepare CMake dependencies
5454
run: |

.github/workflows/tsan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ jobs:
3333
run: |
3434
wget https://apt.llvm.org/llvm.sh
3535
chmod +x llvm.sh
36-
sudo ./llvm.sh 15
36+
sudo ./llvm.sh 16
3737
3838
- name: CMake
3939
run: |
4040
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DUSE_THREADS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
4141
env:
42-
CC: clang-15
43-
CXX: clang++-15
42+
CC: clang-16
43+
CXX: clang++-16
4444

4545
- name: Build cppcheck
4646
run: |

.github/workflows/ubsan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ jobs:
3333
run: |
3434
wget https://apt.llvm.org/llvm.sh
3535
chmod +x llvm.sh
36-
sudo ./llvm.sh 15
36+
sudo ./llvm.sh 16
3737
3838
- name: CMake
3939
run: |
4040
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
4141
env:
42-
CC: clang-15
43-
CXX: clang++-15
42+
CC: clang-16
43+
CXX: clang++-16
4444

4545
- name: Build cppcheck
4646
run: |

clang-tidy.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ We are not interesting in the size/complexity of a function.
5454
These do not (always) increase readability.
5555

5656
`bugprone-macro-parentheses`<br>
57-
`readability-implicit-bool-conversion`<br>
5857

5958
To be documented.
6059

60+
`readability-implicit-bool-conversion`<br>
61+
62+
This does not appear not to be useful as it is reported on very common code.
63+
6164
`bugprone-narrowing-conversions`<br>
6265
`performance-no-automatic-move`<br>
6366

@@ -78,11 +81,11 @@ Disabled because of false positives with Qt `slot` methods (see https://github.c
7881

7982
`-clang-analyzer-*`<br>
8083

81-
Disable because of false positives (needs to file an upstream bug report).
84+
Disabled because of false positives (needs to file an upstream bug report).
8285

8386
`misc-non-private-member-variables-in-classes`<br>
8487

85-
We actively use this.
88+
We intentionally use this.
8689

8790
`misc-no-recursion`<br>
8891

@@ -114,19 +117,27 @@ Produces a lot of false positives since it is too vague in its analysis.
114117

115118
`performance-inefficient-string-concatenation`<br>
116119

117-
Produces many warnings which very much look like false positives (needs to be reported upstream).
120+
Produces warnings which might be considered false positives starting with C++11 - see https://github.com/llvm/llvm-project/issues/54526.
121+
122+
`readability-redundant-access-specifiers`<br>
123+
124+
Reports warning with the Qt `<access-specifier> slots:` syntax in class declarations - see https://github.com/llvm/llvm-project/issues/60055.
118125

119126
`modernize-avoid-c-arrays`<br>
127+
128+
Produces warnings when `const char[]` is being used which is quite common in our code. Does not make sense to enable before C++17 when `std::string_view` becomes available.
129+
Also reports a false positive about templates which deduce the array length: https://github.com/llvm/llvm-project/issues/60053.
130+
120131
`readability-container-size-empty`<br>
121132
`bugprone-branch-clone`<br>
122133
`readability-const-return-type`<br>
123134
`modernize-return-braced-init-list`<br>
124135
`misc-throw-by-value-catch-by-reference`<br>
125136
`readability-avoid-const-params-in-decls`<br>
126137
`bugprone-signed-char-misuse`<br>
127-
`readability-redundant-access-specifiers`<br>
128138
`performance-noexcept-move-constructor`<br>
129139
`concurrency-mt-unsafe`<br>
140+
`misc-use-anonymous-namespace`<br>
130141

131142
To be evaluated.
132143

cmake/clang_tidy.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
99
message(STATUS "Cannot use non-Clang compiler with clang-tidy when precompiled headers are enabled - skipping 'run-clang-tidy' target generation")
1010
endif()
1111
else()
12-
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-15 run-clang-tidy-14 run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8)
12+
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-16 run-clang-tidy-15 run-clang-tidy-14 run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8)
1313
endif()
1414

1515
if (RUN_CLANG_TIDY_NAMES)

cmake/compileroptions.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
101101
add_compile_options_safe(-Wno-tautological-type-limit-compare)
102102
add_compile_options(-Wno-disabled-macro-expansion)
103103
add_compile_options_safe(-Wno-bitwise-instead-of-logical)
104+
add_compile_options_safe(-Wno-unsafe-buffer-usage)
104105

105106
# warnings we are not interested in
106107
add_compile_options(-Wno-four-char-constants)

0 commit comments

Comments
 (0)