Skip to content

Commit fd1019a

Browse files
authored
updated CI to Clang 22 (danmar#7723)
1 parent fdd7b1d commit fd1019a

26 files changed

+80
-63
lines changed

.clang-tidy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ Checks: >
1818
-objc-*,
1919
-openmp-*,
2020
-zircon-*,
21-
cert-err34-c,
2221
cppcoreguidelines-pro-type-static-cast-downcast,
2322
cppcoreguidelines-rvalue-reference-param-not-moved,
2423
google-explicit-constructor,
2524
-bugprone-assignment-in-if-condition,
2625
-bugprone-branch-clone,
26+
-bugprone-command-processor,
2727
-bugprone-easily-swappable-parameters,
2828
-bugprone-empty-catch,
2929
-bugprone-macro-parentheses,
3030
-bugprone-narrowing-conversions,
3131
-bugprone-signed-char-misuse,
3232
-bugprone-switch-missing-default-case,
33+
-bugprone-throwing-static-initialization,
3334
-bugprone-unchecked-optional-access,
3435
-clang-analyzer-*,
3536
-concurrency-mt-unsafe,
@@ -69,9 +70,11 @@ Checks: >
6970
-readability-implicit-bool-conversion,
7071
-readability-isolate-declaration,
7172
-readability-magic-numbers,
73+
-readability-redundant-parentheses,
7274
-readability-suspicious-call-argument,
7375
-readability-uppercase-literal-suffix,
74-
-readability-use-concise-preprocessor-directives
76+
-readability-use-concise-preprocessor-directives,
77+
-misc-unconventional-assign-operator
7578
WarningsAsErrors: '*'
7679
HeaderFilterRegex: '(cli|gui|frontend|lib|oss-fuzz|test|triage)\/[a-z_]+\.h'
7780
ExcludeHeaderFilterRegex: 'ui_.*.h'
@@ -82,3 +85,5 @@ CheckOptions:
8285
value: '0'
8386
- key: modernize-use-trailing-return-type.TransformFunctions
8487
value: false
88+
- key: misc-override-with-different-visibility.DisallowedVisibilityChange
89+
value: widening

.github/workflows/asan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
5555
wget https://apt.llvm.org/llvm.sh
5656
chmod +x llvm.sh
57-
sudo ./llvm.sh 21
57+
sudo ./llvm.sh 22
5858
5959
- name: Install Qt ${{ env.QT_VERSION }}
6060
uses: jurplel/install-qt-action@v4
@@ -76,8 +76,8 @@ jobs:
7676
run: |
7777
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
7878
env:
79-
CC: clang-21
80-
CXX: clang++-21
79+
CC: clang-22
80+
CXX: clang++-22
8181

8282
- name: Build cppcheck
8383
run: |

.github/workflows/clang-tidy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
4444
wget https://apt.llvm.org/llvm.sh
4545
chmod +x llvm.sh
46-
sudo ./llvm.sh 21
47-
sudo apt-get install -y clang-tidy-21
46+
sudo ./llvm.sh 22
47+
sudo apt-get install -y clang-tidy-22
4848
4949
- name: Install Qt ${{ env.QT_VERSION }}
5050
uses: jurplel/install-qt-action@v4
@@ -57,14 +57,14 @@ jobs:
5757

5858
- name: Verify clang-tidy configuration
5959
run: |
60-
clang-tidy-21 --verify-config
60+
clang-tidy-22 --verify-config
6161
6262
- name: Prepare CMake
6363
run: |
6464
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DWARNINGS_ARE_ERRORS=On
6565
env:
66-
CC: clang-21
67-
CXX: clang++-21
66+
CC: clang-22
67+
CXX: clang++-22
6868

6969
- name: Prepare CMake dependencies
7070
run: |

.github/workflows/iwyu.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ jobs:
214214
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
215215
wget https://apt.llvm.org/llvm.sh
216216
chmod +x llvm.sh
217-
sudo ./llvm.sh 21
218-
sudo apt-get install -y clang-tools-21
217+
sudo ./llvm.sh 22
218+
sudo apt-get install -y clang-tools-22
219219
220220
- name: Install libc++
221221
if: matrix.stdlib == 'libc++'
222222
run: |
223-
sudo apt-get install -y libc++-21-dev
223+
sudo apt-get install -y libc++-22-dev
224224
225225
- name: Install Qt ${{ env.QT_VERSION }}
226226
uses: jurplel/install-qt-action@v4
@@ -235,8 +235,8 @@ jobs:
235235
run: |
236236
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }}
237237
env:
238-
CC: clang-21
239-
CXX: clang++-21
238+
CC: clang-22
239+
CXX: clang++-22
240240

241241
- name: Prepare CMake dependencies
242242
run: |
@@ -253,7 +253,7 @@ jobs:
253253
- name: clang-include-cleaner
254254
run: |
255255
# TODO: run multi-threaded
256-
find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-21 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
256+
find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-22 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
257257
258258
- uses: actions/upload-artifact@v4
259259
if: success() || failure()

.github/workflows/tsan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
5454
wget https://apt.llvm.org/llvm.sh
5555
chmod +x llvm.sh
56-
sudo ./llvm.sh 21
56+
sudo ./llvm.sh 22
5757
5858
- name: Install Qt ${{ env.QT_VERSION }}
5959
uses: jurplel/install-qt-action@v4
@@ -75,8 +75,8 @@ jobs:
7575
run: |
7676
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
7777
env:
78-
CC: clang-21
79-
CXX: clang++-21
78+
CC: clang-22
79+
CXX: clang++-22
8080

8181
- name: Build cppcheck
8282
run: |

.github/workflows/ubsan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
5454
wget https://apt.llvm.org/llvm.sh
5555
chmod +x llvm.sh
56-
sudo ./llvm.sh 21
56+
sudo ./llvm.sh 22
5757
5858
- name: Install Qt ${{ env.QT_VERSION }}
5959
uses: jurplel/install-qt-action@v4
@@ -75,8 +75,8 @@ jobs:
7575
run: |
7676
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
7777
env:
78-
CC: clang-21
79-
CXX: clang++-21
78+
CC: clang-22
79+
CXX: clang++-22
8080

8181
- name: Build cppcheck
8282
run: |

clang-tidy.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ Does not improve the readability.
130130
`modernize-use-designated-initializers`<br/>
131131
`readability-enum-initial-value`<br/>
132132
`modernize-use-trailing-return-type`<br/>
133+
`misc-unconventional-assign-operator`<br/>
134+
`bugprone-throwing-static-initialization`<br/>
135+
`bugprone-command-processor`<br/>
133136

134137
To be evaluated (need to remove exclusion).
135138

@@ -156,6 +159,10 @@ These apply to codebases which use later standards then C++11 (C++17 is used whe
156159

157160
We are not interested in this.
158161

162+
`readability-redundant-parentheses`<br/>
163+
164+
Reports false positives - see https://github.com/llvm/llvm-project/issues/164125.
165+
159166
### Disabled for performance reasons
160167

161168
`portability-std-allocator-const`<br/>

cli/signalhandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
238238
}
239239
fprintf(output, " (at 0x%lx).%s\n",
240240
reinterpret_cast<unsigned long>(info->si_addr),
241-
(isAddressOnStack)?" Stackoverflow?":"");
241+
isAddressOnStack ? " Stackoverflow?" : "");
242242
break;
243243
case SIGINT:
244244
unexpectedSignal=false; // legal usage: interrupt application via CTRL-C
@@ -264,7 +264,7 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
264264
(type==-1)? "" :
265265
(type==0) ? "reading " : "writing ",
266266
reinterpret_cast<unsigned long>(info->si_addr),
267-
(isAddressOnStack)?" Stackoverflow?":""
267+
isAddressOnStack ? " Stackoverflow?" : ""
268268
);
269269
break;
270270
case SIGUSR1:

cmake/clang_tidy.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if(NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
1111
message(STATUS "Cannot use non-Clang compiler with clang-tidy when precompiled headers are enabled - skipping 'run-clang-tidy'/'run-clang-tidy-csa' target generation")
1212
endif()
1313
else()
14-
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-21 run-clang-tidy-20 run-clang-tidy-19 run-clang-tidy-18 run-clang-tidy-17 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)
14+
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-22 run-clang-tidy-21 run-clang-tidy-20 run-clang-tidy-19 run-clang-tidy-18 run-clang-tidy-17 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)
1515
endif()
1616

1717
if(RUN_CLANG_TIDY_NAMES)
@@ -25,6 +25,9 @@ if(RUN_CLANG_TIDY_NAMES)
2525
endif()
2626
message(STATUS "NPROC=${NPROC}")
2727

28+
# TODO: introduced in run-clang-tidy-22
29+
set(CLANG_TIDY_CONFIG "-enable-check-profile")
30+
2831
# most of these are disabled because they are too noisy in our code
2932
# clang-analyzer-core.CallAndMessage
3033
# clang-analyzer-core.NonNullParamChecker
@@ -41,13 +44,12 @@ if(RUN_CLANG_TIDY_NAMES)
4144

4245
# TODO: exclude moc_*.cpp
4346
# TODO: exclude mocs_compilation.cpp
44-
# disable all compiler warnings since we are just interested in the tidy ones
4547
add_custom_target(run-clang-tidy
46-
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet
48+
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet ${CLANG_TIDY_CONFIG}
4749
USES_TERMINAL
4850
VERBATIM)
4951
add_custom_target(run-clang-tidy-csa
50-
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet ${CLANG_TIDY_CSA_ALPHA_OPTS} ${CLANG_TIDY_CSA_CONFIG}
52+
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet ${CLANG_TIDY_CONFIG} ${CLANG_TIDY_CSA_ALPHA_OPTS} ${CLANG_TIDY_CSA_CONFIG}
5153
USES_TERMINAL
5254
VERBATIM)
5355
if(BUILD_GUI)

gui/checkthread.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ class CheckThread : public QThread {
7878
mSuppressionsUi = s;
7979
}
8080

81-
/**
82-
* @brief method that is run in a thread
83-
*
84-
*/
85-
void run() override;
86-
8781
void stop();
8882

8983
/**
@@ -137,6 +131,12 @@ class CheckThread : public QThread {
137131
std::shared_ptr<Suppressions> mSuppressions;
138132

139133
private:
134+
/**
135+
* @brief method that is run in a thread
136+
*
137+
*/
138+
void run() override;
139+
140140
void runAddonsAndTools(const Settings& settings, const FileSettings *fileSettings, const QString &fileName);
141141

142142
void parseClangErrors(const QString &tool, const QString &file0, QString err);

0 commit comments

Comments
 (0)