From b3661022154fdac754d75487c16db42f9601d731 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Thu, 3 Apr 2025 08:37:01 -0600 Subject: [PATCH] :construction_worker: Add clang-20 support Problem: - clang-20 is stable and not yet used to compile this repo. Solution: - Add clang-20 support to CI. --- .github/workflows/unit_tests.yml | 19 +++++++++++++++---- CMakeLists.txt | 6 +++--- README.md | 2 +- include/cib/callback.hpp | 2 +- include/log/catalog/mipi_builder.hpp | 4 ++-- include/lookup/linear_search_lookup.hpp | 4 ++-- include/seq/step.hpp | 2 +- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index eef4b229..026ff2ad 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -13,7 +13,7 @@ env: DEBIAN_FRONTEND: noninteractive CMAKE_GENERATOR: Ninja DEFAULT_CXX_STANDARD: 20 - DEFAULT_LLVM_VERSION: 19 + DEFAULT_LLVM_VERSION: 20 DEFAULT_GCC_VERSION: 13 concurrency: @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: compiler: [clang, gcc] - version: [12, 13, 16, 17, 18, 19] + version: [12, 13, 16, 17, 18, 19, 20] cxx_standard: [20] stdlib: [libstdc++, libc++] build_type: [Debug] @@ -36,6 +36,15 @@ jobs: cc: "clang" cxx: "clang++" cxx_flags: "-stdlib=libstdc++" + - version: 20 + compiler: clang + install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 20 all + toolchain_root: "/usr/lib/llvm-20" + - version: 20 + compiler: clang + stdlib: libc++ + install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 20 && sudo apt install -y libc++-20-dev libc++abi-20-dev + cxx_flags: "-stdlib=libc++" - version: 19 compiler: clang install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 19 all @@ -87,6 +96,8 @@ jobs: cxx: "g++-12" cxx_flags: "" exclude: + - compiler: gcc + version: 20 - compiler: gcc version: 19 - compiler: gcc @@ -300,8 +311,8 @@ jobs: - compiler: clang cc: "clang" cxx: "clang++" - install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 19 - toolchain_root: "/usr/lib/llvm-19" + install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 20 + toolchain_root: "/usr/lib/llvm-20" - compiler: gcc cc: "gcc-13" cxx: "g++-13" diff --git a/CMakeLists.txt b/CMakeLists.txt index 89728fb4..ef9a559d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,9 @@ include(cmake/string_catalog.cmake) add_versioned_package("gh:boostorg/mp11#boost-1.83.0") fmt_recipe(11.1.3) -add_versioned_package("gh:intel/cpp-baremetal-concurrency#7c5b26c") -add_versioned_package("gh:intel/cpp-std-extensions#01be679") -add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#0525974") +add_versioned_package("gh:intel/cpp-baremetal-concurrency#0ddce52") +add_versioned_package("gh:intel/cpp-std-extensions#7e1cbc7") +add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#22c8006") set(GEN_STR_CATALOG ${CMAKE_CURRENT_LIST_DIR}/tools/gen_str_catalog.py diff --git a/README.md b/README.md index 70a5041a..0abc41f3 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ to implement *cib* and others extend *cib*. ## Compiler/Standard support The main branch of *cib* currently uses C++20 and is tested with: -- Clang 14 thru 19 +- Clang 14 thru 20 - GCC 12 thru 13 An older version of *cib* that uses C++17 is tagged at v1.7.0. It diff --git a/include/cib/callback.hpp b/include/cib/callback.hpp index 47e76dd3..8fd4c899 100644 --- a/include/cib/callback.hpp +++ b/include/cib/callback.hpp @@ -46,7 +46,7 @@ template struct builder { template ... Fs> [[nodiscard]] constexpr auto add(Fs &&...fs) const { builder cb; - auto i = std::size_t{}; + auto i = 0; while (i < NumFuncs) { cb.funcs[i] = funcs[i]; ++i; diff --git a/include/log/catalog/mipi_builder.hpp b/include/log/catalog/mipi_builder.hpp index bcd3f4fe..323b1591 100644 --- a/include/log/catalog/mipi_builder.hpp +++ b/include/log/catalog/mipi_builder.hpp @@ -139,8 +139,8 @@ template <> struct builder { auto dest = &message.data()[header_size]; auto const ver = stdx::to_le(static_cast(Version)); - dest = std::copy_n(stdx::bit_cast(&ver), - sizeof(std::uint64_t), dest); + std::memcpy(dest, &ver, sizeof(std::uint64_t)); + dest += sizeof(std::uint64_t); std::copy_n(std::cbegin(S.value), S.size(), dest); return message; } diff --git a/include/lookup/linear_search_lookup.hpp b/include/lookup/linear_search_lookup.hpp index 299fac73..caeb5027 100644 --- a/include/lookup/linear_search_lookup.hpp +++ b/include/lookup/linear_search_lookup.hpp @@ -6,7 +6,7 @@ #include #include -#include +#include namespace lookup { template struct linear_search_lookup { @@ -28,7 +28,7 @@ template struct linear_search_lookup { public: [[nodiscard]] CONSTEVAL static auto make(compile_time auto i) { if constexpr (constexpr auto input = i(); input.size <= MaxSize) { - return impl{input}; + return impl>{input}; } else { return strategy_failed_t{}; } diff --git a/include/seq/step.hpp b/include/seq/step.hpp index ce29cde3..2911f89e 100644 --- a/include/seq/step.hpp +++ b/include/seq/step.hpp @@ -22,7 +22,7 @@ struct rt_step { log_func_ptr log_name{}; private: - [[nodiscard]] constexpr friend auto operator==(rt_step const &, + [[nodiscard]] friend constexpr auto operator==(rt_step const &, rt_step const &) -> bool = default; };