From 24f8c91aeba3791e2a586428fc8f95388d40fa21 Mon Sep 17 00:00:00 2001 From: Oliver Deng Date: Tue, 6 Oct 2026 17:20:05 -0400 Subject: [PATCH 01/12] feat: constexpr support with trivial unions --- include/beman/inplace_vector/config.hpp | 8 +++ .../beman/inplace_vector/inplace_vector.hpp | 63 +++++++++++++++++-- 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/include/beman/inplace_vector/config.hpp b/include/beman/inplace_vector/config.hpp index 01aa0ca..43f2649 100644 --- a/include/beman/inplace_vector/config.hpp +++ b/include/beman/inplace_vector/config.hpp @@ -10,4 +10,12 @@ #define BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS() 0 #endif +#ifndef BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION +#if defined(__cpp_trivial_union) && __cpp_trivial_union >= 202602L +#define BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION 1 +#else +#define BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION 0 +#endif +#endif + #endif diff --git a/include/beman/inplace_vector/inplace_vector.hpp b/include/beman/inplace_vector/inplace_vector.hpp index dfd004f..e6183c8 100644 --- a/include/beman/inplace_vector/inplace_vector.hpp +++ b/include/beman/inplace_vector/inplace_vector.hpp @@ -69,7 +69,12 @@ concept satisfy_triviality = std::is_trivially_copyable_v && std::is_trivially_destructible_v; template -concept satisfy_constexpr = N == 0 || satisfy_triviality; +concept satisfy_constexpr = +#if BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION + true; +#else + N == 0 || satisfy_triviality; +#endif template concept lessthan_comparable = requires(const T &a, const T &b) { @@ -140,6 +145,7 @@ template struct trivial { // which makes inplace_vector of non-trivial types non-constexpr-friendly. // // Note: This is not used if trivial union is supported. +#if !BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION template struct raw_byte_based_storage { alignas(T) std::byte _d[sizeof(T) * N]; T *storage_data(size_t i) noexcept { @@ -193,13 +199,60 @@ template struct non_trivial { std::destroy(storage_data(), storage_data() + storage_size()); } }; +#else +template struct union_storage { + static_assert(!satisfy_triviality, + "use storage::trivial for Trivial elements"); + static_assert(N != size_t{0}, "use storage::zero for N==0"); + +protected: + using size_type = smallest_size_t; + +private: + union { + T storage_[N]; + }; + size_type storage_size_ = 0; + +protected: + constexpr const T *storage_data() const noexcept { return storage_; } + constexpr auto storage_data() noexcept { return storage_; } + constexpr size_type storage_size() const noexcept { return storage_size_; } + constexpr void unsafe_set_size(size_t new_size) noexcept { + IV_EXPECT(size_type(new_size) <= N && "new_size out-of-bounds [0, N)"); + storage_size_ = size_type(new_size); + } + +public: + constexpr union_storage() noexcept { std::start_lifetime(storage_); } + constexpr union_storage(const union_storage &) noexcept = default; + constexpr union_storage &operator=(const union_storage &) noexcept = default; + constexpr union_storage(union_storage &&) noexcept = default; + constexpr union_storage &operator=(union_storage &&) noexcept = default; + + constexpr ~union_storage() + requires(std::is_trivially_destructible_v) + = default; + constexpr ~union_storage() + requires(!std::is_trivially_destructible_v) + { + std::destroy(storage_data(), storage_data() + storage_size()); + } +}; +#endif // Selects the vector storage. template -using storage_for = std::conditional_t< - !satisfy_constexpr, non_trivial, - std::conditional_t, trivial>>; - +using storage_for = +#if BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION + std::conditional_t, + std::conditional_t, trivial, + union_storage>>; +#else + std::conditional_t< + !satisfy_constexpr, non_trivial, + std::conditional_t, trivial>>; +#endif } // namespace storage template From aa2ddec15d205bc7120549e4620086f31357fb73 Mon Sep 17 00:00:00 2001 From: Oliver Deng Date: Tue, 6 Oct 2026 17:33:25 -0400 Subject: [PATCH 02/12] test: testing for trivial unions --- tests/beman/inplace_vector/constexpr.test.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/beman/inplace_vector/constexpr.test.cpp b/tests/beman/inplace_vector/constexpr.test.cpp index ace31b2..e472bab 100644 --- a/tests/beman/inplace_vector/constexpr.test.cpp +++ b/tests/beman/inplace_vector/constexpr.test.cpp @@ -45,6 +45,34 @@ static_assert(!has_constexpr_support>); static_assert(has_constexpr_support, 0>>); static_assert(!has_constexpr_support, 50>>); +constexpr bool test_non_trivial_constexpr() { + inplace_vector v; + + // Construction and emplacement in constant evaluation. + v.emplace_back("hello"); + v.emplace_back("world"); + + if (v.size() != 2) + return false; + + if (v[0] != "hello" || v[1] != "world") + return false; + + // Modification of an existing element. + v[0] = "goodbye"; + + if (v[0] != "goodbye") + return false; + + // Destruction of the vector with live non-trivial elements is + // also exercised when leaving this function. + return true; +} + +#if BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION +static_assert(test_non_trivial_constexpr()); +#endif + #define TEST(NAME) \ static_assert(std::invoke([]() { \ NAME>(); \ From 3f17b05a09507fa499ae1dc6209e86f93c72521d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Thu, 9 Jul 2026 22:29:59 +0300 Subject: [PATCH 03/12] Enable beman-tidy (--require-all mode) into beman.inplace_vector (#146) --- .beman-tidy.yaml | 6 ++---- .pre-commit-config.yaml | 1 + README.md | 1 + examples/capacity.cpp | 2 ++ examples/comparison.cpp | 2 ++ examples/fallible.cpp | 2 ++ 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.beman-tidy.yaml b/.beman-tidy.yaml index 24d798b..7e74733 100644 --- a/.beman-tidy.yaml +++ b/.beman-tidy.yaml @@ -4,7 +4,5 @@ # Check documentation for beman-tidy here: # https://github.com/bemanproject/beman-tidy/blob/main/README.md -disabled_rules: - # None -ignored_paths: - # None +disabled_rules: [] +ignored_paths: [] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e6c0161..30d29cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,5 +46,6 @@ repos: rev: v0.5.1 hooks: - id: beman-tidy + args: [".", "--verbose", "--require-all"] exclude: 'cookiecutter/|infra/|port/' diff --git a/README.md b/README.md index 7d216eb..a210683 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [![Lint Check (pre-commit)](https://github.com/bemanproject/inplace_vector/actions/workflows/pre-commit-check.yml/badge.svg)](https://github.com/bemanproject/inplace_vector/actions/workflows/pre-commit-check.yml) [![Coverage](https://coveralls.io/repos/github/bemanproject/inplace_vector/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/inplace_vector?branch=main) ![Standard Target](https://github.com/bemanproject/beman/blob/main/images/badges/cpp29.svg) +[![Compiler Explorer Example](https://img.shields.io/badge/Try%20it%20on%20Compiler%20Explorer-grey?logo=compilerexplorer&logoColor=67c52a)](https://godbolt.org/z/T15TxaTrf) **Implements**: [`inplace_vector` (P0843R14)](https://wg21.link/P0843R14). diff --git a/examples/capacity.cpp b/examples/capacity.cpp index 6686897..2f13bdf 100644 --- a/examples/capacity.cpp +++ b/examples/capacity.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include #include diff --git a/examples/comparison.cpp b/examples/comparison.cpp index 41872f0..b2df113 100644 --- a/examples/comparison.cpp +++ b/examples/comparison.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include #include diff --git a/examples/fallible.cpp b/examples/fallible.cpp index b7034c0..807e5ed 100644 --- a/examples/fallible.cpp +++ b/examples/fallible.cpp @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + #include #include From 7e44fd48e2322a2644a6a8a674fad97778145de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Fri, 10 Jul 2026 03:55:35 +0300 Subject: [PATCH 04/12] Update beman-tidy to 0.5.2 (#147) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30d29cd..bcdc280 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: # Beman Standard checking via beman-tidy - repo: https://github.com/bemanproject/beman-tidy - rev: v0.5.1 + rev: v0.5.2 hooks: - id: beman-tidy args: [".", "--verbose", "--require-all"] From a8214f96500d138074a10f8c110ab812c9a2b85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darius=20Nea=C8=9Bu?= Date: Wed, 22 Jul 2026 23:25:42 +0300 Subject: [PATCH 05/12] docs: align README Build Environment with Beman Standard (#148) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a210683..d9736ec 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,9 @@ This project requires at least the following to build: You can disable building tests by setting CMake option `BEMAN_INPLACE_VECTOR_BUILD_TESTS` to `OFF` when configuring the project. +You can disable building examples by setting CMake option `BEMAN_INPLACE_VECTOR_BUILD_EXAMPLES` to +`OFF` when configuring the project. + ### Supported Platforms | Compiler | Version | C++ Standards | Standard Library | From 9e42a05e39f698031d4209080416ea951d9bd22a Mon Sep 17 00:00:00 2001 From: 20162026 <36726858+20162026@users.noreply.github.com> Date: Sun, 26 Jul 2026 04:16:39 +0300 Subject: [PATCH 06/12] Fix smallest_size_t (#130) --- include/beman/inplace_vector/inplace_vector.hpp | 8 ++++---- tests/beman/inplace_vector/size_n_data.test.cpp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/beman/inplace_vector/inplace_vector.hpp b/include/beman/inplace_vector/inplace_vector.hpp index e6183c8..50f839d 100644 --- a/include/beman/inplace_vector/inplace_vector.hpp +++ b/include/beman/inplace_vector/inplace_vector.hpp @@ -41,10 +41,10 @@ inline constexpr from_range_t from_range; // Smallest unsigned integer that can represent values in [0, N]. template using smallest_size_t -= std::conditional_t<(N < std::numeric_limits::max()), uint8_t, - std::conditional_t<(N < std::numeric_limits::max()), uint16_t, - std::conditional_t<(N < std::numeric_limits::max()), uint32_t, - std::conditional_t<(N < std::numeric_limits::max()), uint64_t, += std::conditional_t<(N <= std::numeric_limits::max()), uint8_t, + std::conditional_t<(N <= std::numeric_limits::max()), uint16_t, + std::conditional_t<(N <= std::numeric_limits::max()), uint32_t, + std::conditional_t<(N <= std::numeric_limits::max()), uint64_t, size_t>>>>; // clang-format on diff --git a/tests/beman/inplace_vector/size_n_data.test.cpp b/tests/beman/inplace_vector/size_n_data.test.cpp index 7b857c6..f689728 100644 --- a/tests/beman/inplace_vector/size_n_data.test.cpp +++ b/tests/beman/inplace_vector/size_n_data.test.cpp @@ -3,9 +3,25 @@ #include #include +#include + #include "gtest_setup.hpp" namespace { +// details::smallest_size_t — smallest unsigned integer holding values in [0, N] +using beman::inplace_vector::details::smallest_size_t; +static_assert(std::is_same_v, uint8_t>); +static_assert(std::is_same_v, uint8_t>); +static_assert(std::is_same_v, uint16_t>); +static_assert(std::is_same_v, uint16_t>); +static_assert(std::is_same_v, uint32_t>); +static_assert(std::is_same_v< + smallest_size_t::max()>, uint32_t>); +static_assert( + std::is_same_v< + smallest_size_t::max()>, + uint64_t>); + // 23.3.14.3 Size and capacity [inplace.vector.capacity] template class SizeNCapacity : public IVBasicTest {}; From 146acfdece075cb0ba375ace5ea619b5c861f381 Mon Sep 17 00:00:00 2001 From: Oliver Deng <32346067+ChronoInferna@users.noreply.github.com> Date: Sat, 25 Jul 2026 21:18:10 -0400 Subject: [PATCH 07/12] fix: add license to examples (#145) From c371918b78b691549c009877780f6f520c962ce2 Mon Sep 17 00:00:00 2001 From: "beman-automated-pr-bot[bot]" <234843859+beman-automated-pr-bot[bot]@users.noreply.github.com> Date: Sat, 25 Jul 2026 18:28:13 -0700 Subject: [PATCH 08/12] Auto-update pre-commit hooks (#141) Co-authored-by: ednolan <907967+ednolan@users.noreply.github.com> --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bcdc280..7830d82 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,14 +14,14 @@ repos: # This brings in a portable version of clang-format. # See also: https://github.com/ssciwr/clang-format-wheel - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v22.1.5 + rev: v22.1.8 hooks: - id: clang-format types_or: [c++, c] # CMake linting and formatting - repo: https://github.com/BlankSpruce/gersemi-pre-commit - rev: 0.27.6 + rev: 0.28.0 hooks: - id: gersemi name: CMake linting @@ -31,12 +31,12 @@ repos: # Config file: .markdownlint.yaml # Commented out to disable this by default. Uncomment to enable markdown linting. - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.48.0 + rev: v0.49.1 hooks: - id: markdownlint - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell exclude: ^tests/beman/inplace_vector/ref_impl\.test\.cpp$ From 485b5f60464bdcd11b02b5b396aebbc7bfce3e19 Mon Sep 17 00:00:00 2001 From: Edward Nolan Date: Wed, 29 Jul 2026 01:06:56 -0400 Subject: [PATCH 09/12] Exemplar updates since 2026-05-24 CMakePresets.json: use absolute (${sourceDir}) toolchain/include paths, add CMAKE_CXX_EXTENSIONS/CMAKE_CXX_STANDARD_REQUIRED, boolean CMAKE_EXPORT_COMPILE_COMMANDS, per-OS hostSystemName conditions on llvm/appleclang/msvc presets, and build 'all_verify_interface_header_sets' + 'all' targets (mirrors exemplar 2efeaf95). infra: bump .beman_submodule to 7b66b858d7f48428fca936184aef2bd246ccc81a and rewrite enable-experimental-import-std.cmake to use CMAKE_VERSION range checks instead of an exhaustive per-patch-version elseif ladder (mirrors exemplar d9d490fab73e). .beman-tidy.yaml: add ignored_paths: [infra/] so beman-tidy (which scans the whole tree via '.') skips the vendored infra/ directory (mirrors exemplar 4884fe72f1fd). infra: bump .beman_submodule to 7fc85e2e26cb491926ca2744c359c2aa7ea8fd27 and add CMAKE_VERSION >= 4.4.0 case (UUID f35a9ac6-8463-4d38-8eec-5d6008153e7d) to enable-experimental-import-std.cmake (mirrors exemplar da85e13c35c7). .pre-commit-config.yaml: bump beman-tidy rev from v0.5.2 to v0.5.4 (mirrors exemplar c863de3fe907); clang-format, gersemi, and codespell revs were already up to date. CMakeLists.txt: bump cmake_minimum_required policy version range from 3.30...4.3 to 3.30...4.4 (mirrors exemplar e9be01c1ffc5). lockfile.json: bump googletest git_tag from git tag hash to commit hash 52eb8108c5bdec04579160ae17225d66034bd723 (v1.17.0) for security best practice (mirrors exemplar f10571bacfc3); no Catch2 dependency present in this repo's lockfile. Bumped bemanproject/infra-workflows reusable workflow references from 1.7.3 to 1.7.4 in all .github/workflows/*.yml files (mirrors exemplar 32b69bd58466). --- .beman-tidy.yaml | 3 +- .exemplar_version | 2 +- .github/workflows/ci_tests.yml | 10 +- .github/workflows/pre-commit-check.yml | 2 +- .github/workflows/pre-commit-update.yml | 2 +- .github/workflows/vcpkg-release.yml | 2 +- .pre-commit-config.yaml | 2 +- CMakeLists.txt | 2 +- CMakePresets.json | 58 ++++- infra/.beman_submodule | 2 +- .../enable-experimental-import-std.cmake | 208 ++---------------- infra/cmake/llvm-libc++-toolchain.cmake | 5 +- lockfile.json | 2 +- 13 files changed, 87 insertions(+), 213 deletions(-) diff --git a/.beman-tidy.yaml b/.beman-tidy.yaml index 7e74733..7a0cc01 100644 --- a/.beman-tidy.yaml +++ b/.beman-tidy.yaml @@ -5,4 +5,5 @@ # https://github.com/bemanproject/beman-tidy/blob/main/README.md disabled_rules: [] -ignored_paths: [] +ignored_paths: + - infra/ diff --git a/.exemplar_version b/.exemplar_version index 14f6221..dae4ed7 100644 --- a/.exemplar_version +++ b/.exemplar_version @@ -1 +1 @@ -ec861600898941a5114f352f1efcba57d825b6d0 +32b69bd5846676013a204ce3c3fcbd6c074ea701 diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 91abb56..f571596 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -17,10 +17,10 @@ concurrency: jobs: beman-submodule-check: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.7.4 preset-test: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.7.4 with: matrix_config: > [ @@ -33,7 +33,7 @@ jobs: ] build-and-test: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.7.4 with: matrix_config: > { @@ -126,11 +126,11 @@ jobs: } vcpkg-ci: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-ci.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-ci.yml@1.7.4 with: port_name: beman-inplace-vector create-issue-when-fault: needs: [preset-test, build-and-test] if: failure() && github.event_name == 'schedule' - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.7.4 diff --git a/.github/workflows/pre-commit-check.yml b/.github/workflows/pre-commit-check.yml index d65a3cc..85350c4 100644 --- a/.github/workflows/pre-commit-check.yml +++ b/.github/workflows/pre-commit-check.yml @@ -17,4 +17,4 @@ permissions: jobs: pre-commit: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.7.4 diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml index 89b239f..0f0cb90 100644 --- a/.github/workflows/pre-commit-update.yml +++ b/.github/workflows/pre-commit-update.yml @@ -9,7 +9,7 @@ on: jobs: auto-update-pre-commit: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.7.4 secrets: APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }} PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }} diff --git a/.github/workflows/vcpkg-release.yml b/.github/workflows/vcpkg-release.yml index cdd3a40..7ff6c99 100644 --- a/.github/workflows/vcpkg-release.yml +++ b/.github/workflows/vcpkg-release.yml @@ -6,7 +6,7 @@ on: types: [published] jobs: vcpkg-release: - uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-release.yml@1.7.3 + uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-release.yml@1.7.4 with: port_name: beman-inplace-vector secrets: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7830d82..68dc751 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: # Beman Standard checking via beman-tidy - repo: https://github.com/bemanproject/beman-tidy - rev: v0.5.2 + rev: v0.5.4 hooks: - id: beman-tidy args: [".", "--verbose", "--require-all"] diff --git a/CMakeLists.txt b/CMakeLists.txt index 7594fa2..97fae0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -cmake_minimum_required(VERSION 3.30...4.3) +cmake_minimum_required(VERSION 3.30...4.4) project( beman.inplace_vector diff --git a/CMakePresets.json b/CMakePresets.json index 483e1a3..09df0e5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -8,8 +8,10 @@ "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { "CMAKE_CXX_STANDARD": "20", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "./infra/cmake/use-fetch-content.cmake" + "CMAKE_CXX_EXTENSIONS": false, + "CMAKE_CXX_STANDARD_REQUIRED": true, + "CMAKE_EXPORT_COMPILE_COMMANDS": true, + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "${sourceDir}/infra/cmake/use-fetch-content.cmake" } }, { @@ -35,7 +37,7 @@ "_debug-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/gnu-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/gnu-toolchain.cmake" } }, { @@ -46,7 +48,7 @@ "_release-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/gnu-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/gnu-toolchain.cmake" } }, { @@ -57,7 +59,12 @@ "_debug-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/llvm-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/llvm-toolchain.cmake" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" } }, { @@ -68,7 +75,12 @@ "_release-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/llvm-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/llvm-toolchain.cmake" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" } }, { @@ -79,7 +91,12 @@ "_debug-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/appleclang-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/appleclang-toolchain.cmake" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" } }, { @@ -90,7 +107,12 @@ "_release-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/appleclang-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/appleclang-toolchain.cmake" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" } }, { @@ -101,7 +123,12 @@ "_debug-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/msvc-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/msvc-toolchain.cmake" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" } }, { @@ -112,7 +139,12 @@ "_release-base" ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "infra/cmake/msvc-toolchain.cmake" + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/msvc-toolchain.cmake" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" } } ], @@ -120,7 +152,11 @@ { "name": "_root-build", "hidden": true, - "jobs": 0 + "jobs": 0, + "targets": [ + "all_verify_interface_header_sets", + "all" + ] }, { "name": "gcc-debug", diff --git a/infra/.beman_submodule b/infra/.beman_submodule index a24c23d..26f1dbf 100644 --- a/infra/.beman_submodule +++ b/infra/.beman_submodule @@ -1,3 +1,3 @@ [beman_submodule] remote=https://github.com/bemanproject/infra.git -commit_hash=d536fc285ae058cf8f5b736b5ff73d18a421b296 +commit_hash=749c5588afe37daaa290b659d439cd7cd473ad1b diff --git a/infra/cmake/enable-experimental-import-std.cmake b/infra/cmake/enable-experimental-import-std.cmake index 0ac9604..3c6d688 100644 --- a/infra/cmake/enable-experimental-import-std.cmake +++ b/infra/cmake/enable-experimental-import-std.cmake @@ -1,194 +1,28 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -if(CMAKE_VERSION VERSION_EQUAL "3.30.0") +if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.4.0") set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" + "f35a9ac6-8463-4d38-8eec-5d6008153e7d" ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.1") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.2") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.3") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.4") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.5") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.6") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.7") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.8") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.30.9") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.0") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.1") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.10") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.11") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.12") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.2") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.3") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.4") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.5") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.6") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.7") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.8") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "3.31.9") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.0") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "a9e1cf81-9932-4810-974b-6eccaf14e457" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.1") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "a9e1cf81-9932-4810-974b-6eccaf14e457" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.2") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "a9e1cf81-9932-4810-974b-6eccaf14e457" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.3") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.4") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.5") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.6") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.0.7") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.1.0") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.1.1") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.1.2") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.1.3") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.1.4") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.1.5") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.1.6") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.2.0") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.2.1") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.2.2") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.2.3") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.2.4") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.2.5") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "d0edc3af-4c50-42ea-a356-e2862fe7a444" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.3.0") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "451f2fe2-a8a2-47c3-bc32-94786d8fc91b" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.3.1") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "451f2fe2-a8a2-47c3-bc32-94786d8fc91b" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.3.2") - set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD - "451f2fe2-a8a2-47c3-bc32-94786d8fc91b" - ) -elseif(CMAKE_VERSION VERSION_EQUAL "4.3.3") +elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "4.3.0") set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "451f2fe2-a8a2-47c3-bc32-94786d8fc91b" ) +elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0") + if(CMAKE_VERSION VERSION_LESS "3.31.8") + set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD + "0e5b6991-d74f-4b3d-a41c-cf096e0b2508" + ) + elseif(CMAKE_VERSION VERSION_LESS "4.0.0") + set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD + "d0edc3af-4c50-42ea-a356-e2862fe7a444" + ) + elseif(CMAKE_VERSION VERSION_LESS "4.0.3") + set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD + "a9e1cf81-9932-4810-974b-6eccaf14e457" + ) + elseif(CMAKE_VERSION VERSION_LESS "4.3.0") + set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD + "d0edc3af-4c50-42ea-a356-e2862fe7a444" + ) + endif() endif() diff --git a/infra/cmake/llvm-libc++-toolchain.cmake b/infra/cmake/llvm-libc++-toolchain.cmake index eabf363..aac8502 100644 --- a/infra/cmake/llvm-libc++-toolchain.cmake +++ b/infra/cmake/llvm-libc++-toolchain.cmake @@ -16,5 +16,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/llvm-toolchain.cmake) if(NOT CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+") - string(APPEND CMAKE_CXX_FLAGS " -stdlib=libc++") + string( + APPEND CMAKE_CXX_FLAGS + " -stdlib=libc++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + ) endif() diff --git a/lockfile.json b/lockfile.json index 787b905..91bafbe 100644 --- a/lockfile.json +++ b/lockfile.json @@ -4,7 +4,7 @@ "name": "googletest", "package_name": "GTest", "git_repository": "https://github.com/google/googletest.git", - "git_tag": "6910c9d9165801d8827d628cb72eb7ea9dd538c5", + "git_tag": "52eb8108c5bdec04579160ae17225d66034bd723", "cmake_args": { "INSTALL_GTEST": "OFF" } From 26181da137777621bcb8deb28499b35d5fc7412a Mon Sep 17 00:00:00 2001 From: Edward Nolan Date: Thu, 17 Sep 2026 21:05:09 +0000 Subject: [PATCH 10/12] Add Clang 23 to CI Move the full Clang test matrix (all C++ standards, libstdc++ and libc++, sanitizers and Werror) from Clang 22 to Clang 23, and demote Clang 22 to the Release.Default-only tier alongside Clang 21-19. The supported platforms table in README.md was regenerated with beman-readme-platforms. Verified locally with beman-local-ci --compiler clang --versions 23: 12 passed, 0 failed. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/ci_tests.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index f571596..137e745 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -65,7 +65,7 @@ jobs: } ], "clang": [ - { "versions": ["22"], + { "versions": ["23"], "tests": [ {"cxxversions": ["c++26"], "tests": [ @@ -84,7 +84,7 @@ jobs: } ] }, - { "versions": ["21", "20", "19"], + { "versions": ["22", "21", "20", "19"], "tests": [ { "cxxversions": ["c++26", "c++23", "c++20"], "tests": [ diff --git a/README.md b/README.md index d9736ec..97a5279 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ You can disable building examples by setting CMake option `BEMAN_INPLACE_VECTOR_ | Compiler | Version | C++ Standards | Standard Library | |------------|---------|---------------|-------------------| | GCC | 16-13 | C++26-C++20 | libstdc++ | -| Clang | 22-19 | C++26-C++20 | libstdc++, libc++ | +| Clang | 23-19 | C++26-C++20 | libstdc++, libc++ | | Clang | 18 | C++26-C++20 | libc++ | | Clang | 18 | C++23, C++20 | libstdc++ | | Clang | 17 | C++26-C++20 | libc++ | From 9b46ac0cf30e09d62dbd9406cce2f7d28b766ab4 Mon Sep 17 00:00:00 2001 From: Oliver Deng Date: Wed, 14 Oct 2026 20:25:43 -0400 Subject: [PATCH 11/12] build: add trunk to ci --- .github/workflows/ci_tests.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 137e745..21a7d28 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -65,6 +65,15 @@ jobs: } ], "clang": [ + { "versions": ["trunk"], + "tests": [ + { "cxxversions": ["c++26"], + "tests": [ + {"stdlibs": ["libstdc++", "libc++"], "tests": ["Release.Default"]} + ] + } + ] + }, { "versions": ["23"], "tests": [ {"cxxversions": ["c++26"], From fe51736618016114af6b9a2099eeab8bc0d0ad91 Mon Sep 17 00:00:00 2001 From: Oliver Deng Date: Thu, 15 Oct 2026 14:00:51 -0400 Subject: [PATCH 12/12] build: add gcc trunk --- .github/workflows/ci_tests.yml | 7 +++++++ include/beman/inplace_vector/config.hpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 21a7d28..711ac39 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -38,6 +38,13 @@ jobs: matrix_config: > { "gcc": [ + { "versions": ["trunk"], + "tests": [ + { "cxxversions": ["c++26"], + "tests": [{ "stdlibs": ["libstdc++"], "tests": ["Release.Default"]}] + } + ] + }, { "versions": ["16"], "tests": [ { "cxxversions": ["c++26"], diff --git a/include/beman/inplace_vector/config.hpp b/include/beman/inplace_vector/config.hpp index 43f2649..9ec840e 100644 --- a/include/beman/inplace_vector/config.hpp +++ b/include/beman/inplace_vector/config.hpp @@ -11,7 +11,7 @@ #endif #ifndef BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION -#if defined(__cpp_trivial_union) && __cpp_trivial_union >= 202602L +#if defined(__cpp_trivial_union) && __cpp_trivial_union >= 202502L #define BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION 1 #else #define BEMAN_INPLACE_VECTOR_HAS_TRIVIAL_UNION 0