Skip to content

Commit 2474fad

Browse files
authored
updated CI to Clang 20 (#6649)
1 parent bad59f0 commit 2474fad

10 files changed

+31
-20
lines changed

.github/workflows/asan.yml

+3-3
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 19
56+
sudo ./llvm.sh 20
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 -DUSE_QT6=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_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
7777
env:
78-
CC: clang-19
79-
CXX: clang++-19
78+
CC: clang-20
79+
CXX: clang++-20
8080

8181
- name: Build cppcheck
8282
run: |

.github/workflows/clang-tidy.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
4141
wget https://apt.llvm.org/llvm.sh
4242
chmod +x llvm.sh
43-
sudo ./llvm.sh 19
44-
sudo apt-get install -y clang-tidy-19
43+
sudo ./llvm.sh 20
44+
sudo apt-get install -y clang-tidy-20
4545
4646
- name: Install Qt ${{ env.QT_VERSION }}
4747
uses: jurplel/install-qt-action@v4
@@ -53,14 +53,14 @@ jobs:
5353

5454
- name: Verify clang-tidy configuration
5555
run: |
56-
clang-tidy-19 --verify-config
56+
clang-tidy-20 --verify-config
5757
5858
- name: Prepare CMake
5959
run: |
6060
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off -DWARNINGS_ARE_ERRORS=On
6161
env:
62-
CC: clang-19
63-
CXX: clang++-19
62+
CC: clang-20
63+
CXX: clang++-20
6464

6565
- name: Prepare CMake dependencies
6666
run: |

.github/workflows/iwyu.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ jobs:
182182
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
183183
wget https://apt.llvm.org/llvm.sh
184184
chmod +x llvm.sh
185-
sudo ./llvm.sh 19
186-
sudo apt-get install -y clang-tools-19
185+
sudo ./llvm.sh 20
186+
sudo apt-get install -y clang-tools-20
187187
188188
- name: Install libc++
189189
if: matrix.stdlib == 'libc++'
@@ -203,8 +203,8 @@ jobs:
203203
# TODO: why does it build dmake in the next step?
204204
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }}
205205
env:
206-
CC: clang-19
207-
CXX: clang++-19
206+
CC: clang-20
207+
CXX: clang++-20
208208

209209
- name: Prepare CMake dependencies
210210
run: |
@@ -221,7 +221,7 @@ jobs:
221221
- name: clang-include-cleaner
222222
run: |
223223
# TODO: run multi-threaded
224-
find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-19 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
224+
find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-20 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
225225
226226
- uses: actions/upload-artifact@v4
227227
if: success() || failure()

.github/workflows/tsan.yml

+3-3
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 19
56+
sudo ./llvm.sh 20
5757
5858
- name: Install Qt ${{ env.QT_VERSION }}
5959
uses: jurplel/install-qt-action@v4
@@ -74,8 +74,8 @@ jobs:
7474
run: |
7575
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=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_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
7676
env:
77-
CC: clang-19
78-
CXX: clang++-19
77+
CC: clang-20
78+
CXX: clang++-20
7979

8080
- name: Build cppcheck
8181
run: |

.github/workflows/ubsan.yml

+3-3
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 19
56+
sudo ./llvm.sh 20
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 -DUSE_QT6=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_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
7777
env:
78-
CC: clang-19
79-
CXX: clang++-19
78+
CC: clang-20
79+
CXX: clang++-20
8080

8181
- name: Build cppcheck
8282
run: |

cmake/clang_tidy.cmake

+1-1
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' target generation")
1212
endif()
1313
else()
14-
set(RUN_CLANG_TIDY_NAMES run-clang-tidy 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-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)

cmake/dynamic_analyzer_options.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ if(ANALYZE_UNDEFINED)
3131
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=nullability")
3232
endif()
3333
endif()
34+
35+
if(ANALYZE_TYPE)
36+
add_compile_options(-fsanitize=type)
37+
38+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=type")
39+
endif()

cmake/options.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ endif()
2020
option(ANALYZE_ADDRESS "Build with AddressSanitzer to detect memory error" OFF)
2121
option(ANALYZE_THREAD "Build with ThreadSanitizer to detect data races" OFF)
2222
option(ANALYZE_UNDEFINED "Build with UndefinedBehaviorSanitizer to detect undefined behavior" OFF)
23+
option(ANALYZE_TYPE "Build with TypeSanitizer to detect aliasing issues" OFF)
2324

2425
option(WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF)
2526
if(WARNINGS_ARE_ERRORS)

cmake/printInfo.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ message(STATUS "ANALYZE_MEMORY = ${ANALYZE_MEMORY}")
3030
message(STATUS "ANALYZE_ADDRESS = ${ANALYZE_ADDRESS}")
3131
message(STATUS "ANALYZE_THREAD = ${ANALYZE_THREAD}")
3232
message(STATUS "ANALYZE_UNDEFINED = ${ANALYZE_UNDEFINED}")
33+
message(STATUS "ANALYZE_TYPE = ${ANALYZE_TYPE}")
3334
message(STATUS)
3435
message(STATUS "WARNINGS_ARE_ERRORS = ${WARNINGS_ARE_ERRORS}")
3536
message(STATUS "EXTERNALS_AS_SYSTEM = ${EXTERNALS_AS_SYSTEM}")

lib/library.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ Library::Library(const Library& other)
157157

158158
Library& Library::operator=(const Library& other) &
159159
{
160+
if (this == &other)
161+
return *this;
162+
160163
mData.reset(new LibraryData(*other.mData));
161164
return *this;
162165
}

0 commit comments

Comments
 (0)