Fix build error: replace C++26 std::runtime_format with C++20-compatible wrapper#7367
Merged
DennisOSRM merged 2 commits intocopilot/replace-boost-format-with-libfmtfrom Feb 19, 2026
Conversation
…at wrapper Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix build errors in project
Fix build error: replace C++26 Feb 19, 2026
std::runtime_format with C++20-compatible wrapper
Copilot stopped work on behalf of
DennisOSRM due to an error
February 19, 2026 16:02
DennisOSRM
added a commit
that referenced
this pull request
Feb 21, 2026
* Initial plan * Replace boost::format with libfmt across the codebase Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Remove unnecessary util/log.hpp include from shared_monitor.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Fix code formatting as reported by CI Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Fix npm audit security vulnerability in tar package Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <memory> include to multi_level_partition.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <memory> include to compressed_edge_container.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <vector> include to io_config.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <string> and <cstring> includes to storage headers Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing includes: util/format.hpp and <vector> Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Fix runtime format string handling for C++20 std::format compatibility Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * [WIP] Fix build errors in project (#7367) * Fix clang-format-18 formatting in include/util/format.hpp (#7368) * Fix std::make_format_args rvalue binding error with GCC 13 (#7369) * Fix missing `<unistd.h>` include for macOS in io-benchmark (#7370) * Move `#ifdef OSRM_HAS_STD_FORMAT` from call sites into `format.hpp` (#7371) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> Co-authored-by: Dennis Luxen <info@project-osrm.org>
MarcelloPerathoner
pushed a commit
to MarcelloPerathoner/osrm-backend
that referenced
this pull request
Feb 24, 2026
* Initial plan * Replace boost::format with libfmt across the codebase Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Remove unnecessary util/log.hpp include from shared_monitor.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Fix code formatting as reported by CI Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Fix npm audit security vulnerability in tar package Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <memory> include to multi_level_partition.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <memory> include to compressed_edge_container.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <vector> include to io_config.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing <string> and <cstring> includes to storage headers Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Add missing includes: util/format.hpp and <vector> Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * Fix runtime format string handling for C++20 std::format compatibility Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> * [WIP] Fix build errors in project (Project-OSRM#7367) * Fix clang-format-18 formatting in include/util/format.hpp (Project-OSRM#7368) * Fix std::make_format_args rvalue binding error with GCC 13 (Project-OSRM#7369) * Fix missing `<unistd.h>` include for macOS in io-benchmark (Project-OSRM#7370) * Move `#ifdef OSRM_HAS_STD_FORMAT` from call sites into `format.hpp` (Project-OSRM#7371) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> Co-authored-by: Dennis Luxen <info@project-osrm.org>
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.
std::runtime_formatis a C++26 feature, but was used unconditionally in theOSRM_HAS_STD_FORMATbranch, which activates as soon as C++20std::formatis detected — causing a build failure with clang++-16.Changes
include/util/format.hpp: Replaceusing std::runtime_formatwith a C++20-compatible shim:RuntimeFormatString— lightweight wrapper aroundstd::string_viewruntime_format(std::string_view)— factory mirroring thefmt::runtime()APIformat(RuntimeFormatString, Args...)— overload dispatching tostd::vformat(available since C++20)Compile-time
format("{}", x)calls remain unambiguous —std::format_string<Args...>has aconstevalconstructor and cannot be satisfied byRuntimeFormatString, so overload resolution is clean.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.