Switch CCF builds to C++23 - #8234
Merged
Merged
Conversation
Require and propagate C++23 across CCF and downstream application targets, update the install-test compiler fallback, and adopt the newly available standard utilities. Fix C++23 build incompatibilities in SmallVector consumers and incomplete pimpl declarations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Record the downstream C++23 requirement and retained Clang 18.1.2 minimum in the 7.0.13 changelog. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apache Arrow 15 still uses std::aligned_storage, which libstdc++ 13 deprecates in C++23 mode. Suppress that warning only while parsing Arrow and Parquet headers so project warnings remain errors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Amaury Chamayou (achamayou)
marked this pull request as ready for review
September 1, 2026 10:43
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
September 1, 2026 10:44
View session
Max (maxtropets)
approved these changes
Sep 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates CCF’s build and public CMake targets to require C++23, and modernises several call sites to use C++23 standard library APIs (eg std::to_underlying, std::ranges::contains, std::string{,_view}::contains, std::unreachable) while keeping tests and vendored include sites compatible.
Changes:
- Switch default CMake C++ standard to 23 and propagate
cxx_std_23via exported/linked targets. - Update the install-build smoke test to fall back to Clang 18.
- Replace legacy shims/patterns with C++23 equivalents (string/ranges
contains,std::to_underlying,std::unreachable) and adjust a few includes/headers accordingly.
Custom instructions used:
- None (no additional
.github/copilot-instructions.md/.github/instructions/*files were loaded via tools in this review).
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_install_build.sh | Update compiler fallback to clang/clang++ 18 for install-build smoke test. |
| src/tasks/worker.cpp | Use std::unreachable() (and include <utility>). |
| src/tasks/test/basic_tasks.cpp | Use std::string::contains in task tests. |
| src/tasks/ordered_tasks.h | Remove redundant = nullptr from unique_ptr pimpl member. |
| src/tasks/job_board.h | Remove redundant = nullptr from unique_ptr pimpl member. |
| src/tasks/fan_in_tasks.h | Remove redundant = nullptr from unique_ptr pimpl member. |
| src/node/test/js_policy.cpp | Use std::string::contains in policy error-handling tests. |
| src/node/test/historical_queries.cpp | Replace std::find with std::ranges::contains in historical query tests. |
| src/node/rpc/test/frontend_test.cpp | Use std::string::contains in RPC frontend tests. |
| src/node/rpc/test/frontend_test_infra.h | Use std::string::contains in shared test helper. |
| src/node/rpc/node_frontend_utils.h | Use std::to_underlying for enum formatting in error path (include <utility>). |
| src/node/rpc/file_serving_handlers.h | Use std::string::contains when parsing range headers. |
| src/node/node_state.h | Use std::string_view::contains in hostname/IP detection. |
| src/node/node_inbound_message.h | Use std::to_underlying for enum formatting in error path (include <utility>). |
| src/kv/untyped_map.h | Remove obsolete operator!= shim now that C++23 is required. |
| src/kv/test/kv_test.cpp | Use std::string::contains in KV unit tests. |
| src/kv/raw_serialise.h | Wrap vendored SmallVector include with deprecation-warning suppression pragmas. |
| src/js/test/js.cpp | Use std::string::contains in JS KV map access test helper. |
| src/js/extensions/ccf/kv_helpers.h | Remove outdated comment about std::to_underlying. |
| src/http/test/http_test.cpp | Add <algorithm> and use contains / std::ranges::contains in HTTP tests. |
| src/http/http2_parser.h | Use std::to_underlying for HTTP status formatting (include <utility>). |
| src/host/test/ledger.cpp | Use std::string::contains for ledger filename checks. |
| src/ds/test/messaging.cpp | Use std::string::contains in exception message assertions. |
| src/ds/test/logger.cpp | Use std::string::contains in logger output assertions. |
| src/ds/test/json_schema.cpp | Add <algorithm> and use std::ranges::contains in schema tests. |
| src/crypto/test/crypto.cpp | Use std::string::contains in certificate validity assertions. |
| src/crypto/pem.cpp | Use std::string::contains in PEM format validation. |
| src/cose/test/cose_ffi_test.cpp | Use std::string::contains in COSE error assertions. |
| src/consensus/aft/test/committable_suffix.cpp | Add <algorithm> and use std::ranges::contains in AFT test helper. |
| src/common/cli_helper.h | Use std::string::contains for IPv6 bracket validation. |
| include/ccf/tx_status.h | Use std::to_underlying in FinalTxStatus and include <utility>. |
| include/ccf/service/tables/proposals.h | Use std::to_underlying for proposal-state formatting and include <utility>. |
| include/ccf/service/node_info_network.h | Use std::string::contains in address parsing/formatting helpers. |
| include/ccf/js/kv_access_permissions.h | Implement permission intersection via std::to_underlying (include <utility>). |
| include/ccf/endpoint.h | Use std::to_underlying in forwarding-required formatter. |
| include/ccf/ds/logger.h | Use std::to_underlying for logger level indexing (include <utility>). |
| include/ccf/ds/hash.h | Wrap vendored SmallVector include with deprecation-warning suppression pragmas. |
| include/ccf/ds/enum_formatter.h | Use std::to_underlying in generic enum formatter (include <utility>). |
| include/ccf/byte_vector.h | Wrap vendored SmallVector include with deprecation-warning suppression pragmas. |
| cmake/preproject.cmake | Set CMAKE_CXX_STANDARD to 23 and require it. |
| cmake/crypto.cmake | Propagate cxx_std_23 on ccfcrypto target. |
| cmake/ccf_app.cmake | Apply/propagate cxx_std_23 on app and static library helper targets. |
| CHANGELOG.md | Document the C++23 requirement and exported-target propagation (#8234). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
CMAKE_CXX_STANDARD from preproject.cmake already reaches consumers via ccf-config.cmake, so the target_compile_features calls added nothing. Match the codebase convention of #pragma clang diagnostic at the SmallVector include sites. Move the changelog entry to 7.0.14, as 7.0.13 has been released. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3eea2ed7-7f60-42f3-8cdc-cb7e7090cb51
cjen1-msft
reviewed
Sep 1, 2026
Amaury Chamayou (achamayou)
enabled auto-merge (squash)
September 1, 2026 11:03
cjen1-msft
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CMAKE_CXX_STANDARDinpreproject.cmake, which reaches downstream consumers throughccf-config.cmakeSmallVectorinclude sites (std::aligned_unionis deprecated by P1413R3) and incomplete pimpl declarationsstd::to_underlying, string and rangescontains, andstd::unreachable, and remove the obsolete comparison shim