Skip to content

Commit a4305c9

Browse files
nonassaAlan Lan
authored andcommitted
Fix clang-tidy CI: use libc++ for C++23 std::expected support (TICKET_494)
clang-18 does not define __cpp_lib_expected, so libstdc++-14's <expected> header is effectively empty. Switch clang-tidy to libc++-18 which has full C++23 support. Fix four headers with missing includes exposed once clang-tidy can actually parse the code: <concepts> in seqlock.hpp, <type_traits> in diagnostic.hpp, buffer_pool.hpp in mpsc_queue.hpp, trailer.hpp in fixt11/session.hpp.
1 parent ec645f2 commit a4305c9

5 files changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
- name: Install dependencies
167167
run: |
168168
sudo apt-get update
169-
sudo apt-get install -y ninja-build clang-tidy-18 clang-18 libstdc++-14-dev
169+
sudo apt-get install -y ninja-build clang-tidy-18 clang-18 libc++-18-dev libc++abi-18-dev
170170
171171
- name: Configure
172172
env:
@@ -183,20 +183,13 @@ jobs:
183183
-DNFX_ENABLE_LOGGING=OFF \
184184
-DNFX_ENABLE_ABSEIL=OFF
185185
186-
- name: Detect GCC toolchain for clang
187-
id: gcc
188-
run: |
189-
GCC_VER=$(ls /usr/include/c++/ | grep -E '^[0-9]+$' | sort -n | tail -1)
190-
echo "ver=${GCC_VER}" >> "$GITHUB_OUTPUT"
191-
192186
- name: Run clang-tidy
193187
run: |
194188
find include/nexusfix -name '*.hpp' | \
195189
xargs clang-tidy-18 -p build --warnings-as-errors='*' \
196190
--extra-arg=-std=c++23 \
191+
--extra-arg=-stdlib=libc++ \
197192
--extra-arg=-Iinclude \
198-
--extra-arg=-isystem/usr/include/c++/${{ steps.gcc.outputs.ver }} \
199-
--extra-arg=-isystem/usr/include/x86_64-linux-gnu/c++/${{ steps.gcc.outputs.ver }} \
200193
2>&1 | \
201194
tee clang-tidy-output.txt
202195
if grep -q 'error:' clang-tidy-output.txt; then

include/nexusfix/memory/mpsc_queue.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <new>
3535

3636
#include "wait_strategy.hpp"
37+
#include "nexusfix/memory/buffer_pool.hpp"
3738
#include "nexusfix/util/compiler.hpp"
3839

3940
#ifdef _MSC_VER

include/nexusfix/memory/seqlock.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#pragma once
2626

2727
#include <atomic>
28+
#include <concepts>
2829
#include <cstdint>
2930
#include <new>
3031
#include <type_traits>

include/nexusfix/messages/fixt11/session.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "nexusfix/parser/field_view.hpp"
1212
#include "nexusfix/parser/runtime_parser.hpp"
1313
#include "nexusfix/messages/common/header.hpp"
14+
#include "nexusfix/messages/common/trailer.hpp"
1415

1516
namespace nfx::fixt11 {
1617

include/nexusfix/util/diagnostic.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <source_location>
2020
#include <cstdio>
2121
#include <cstdlib>
22+
#include <type_traits>
2223

2324
namespace nfx::util {
2425

0 commit comments

Comments
 (0)