Repository navigation
Fix MSVC for C++20 - #5159
Merged
Merged
Fix MSVC for C++20#5159
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the codebase from C++17 to C++20 to fix MSVC compilation issues. The changes primarily update compiler settings, library dependencies, and adjust code to be compatible with C++20 requirements and newer versions of the fmt library.
Changes:
- Updated C++ standard from C++17 to C++20 across build configurations and documentation
- Modified fmt library usage to accommodate breaking changes (wrapping format strings with
fmt::runtime(), removingFMT_STRINGmacro, addingfmt/ranges.hincludes) - Replaced deprecated C++ features (operator< with operator<=>, std::result_of with std::invoke_result_t, template parameter syntax)
- Updated build configuration files and dependencies (xdrpp, spdlog, fmt submodules)
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/util/xdrquery/XDRQueryEval.cpp | Added fmt/ranges.h include for fmt compatibility |
| src/util/xdrquery/XDRFieldResolver.h | Added fmt/ranges.h include for fmt compatibility |
| src/util/XDROperators.h | Replaced operator< with C++20 spaceship operator (operator<=>) |
| src/util/Logging.h | Removed FMT_STRING macro wrapping from logging macros |
| src/util/Logging.cpp | Wrapped format string with fmt::runtime() and replaced fmt::localtime() with std::localtime() |
| src/util/DebugMetaUtils.h | Changed std::string constant to constexpr char array for compile-time format string |
| src/test/test.cpp | Added fmt/ranges.h include |
| src/main/test/ConfigTests.cpp | Changed string constants to constexpr char arrays and wrapped format string with fmt::runtime() |
| src/ledger/LedgerEntryScope.h | Removed redundant template parameter from deleted constructor |
| src/history/HistoryArchive.cpp | Wrapped format string with fmt::runtime() for dynamic formatting |
| m4/ax_cxx_compile_stdcxx_14.m4 | Removed obsolete C++14 standard check macro file |
| m4/ax_cxx_compile_stdcxx.m4 | Updated to support C++20 and C++23, added MSVC-specific compiler flag handling |
| lib/xdrpp | Updated submodule commit for C++20 compatibility |
| lib/spdlog | Updated submodule commit for C++20 compatibility |
| lib/fmt | Updated submodule commit for newer fmt library version |
| lib/autocheck/include/autocheck/classifier.hpp | Replaced deprecated std::result_of with std::invoke_result_t |
| configure.ac | Updated to require C++20 standard instead of C++17 |
| README.md | Updated documentation to reflect C++20 requirement |
| INSTALL.md | Updated build dependencies to specify C++20 support requirement |
| Builds/VisualStudio/*.vcxproj | Updated MSVC projects to use C++20 standard and added UTF-8 compiler flag |
drebelsky
reviewed
Feb 27, 2026
dmkozh
previously approved these changes
Feb 27, 2026
Contributor
|
Could you please rebase instead of merging? |
graydon
force-pushed
the
fix-cpp20-msvc
branch
from
February 27, 2026 20:49
73403a0 to
ebdd20c
Compare
bboston7
approved these changes
Feb 27, 2026
Closed
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.
This extends PR #5091 with fixes to the msvc build. It should merge after that PR. Only the second commit here is relevant.