Repository navigation
Fix output position for compiled variant and expected formatting - #4968
Merged
Merged
Conversation
fhgffy
marked this pull request as ready for review
October 3, 2026 23:34
vitaut
approved these changes
Oct 7, 2026
Contributor
|
Thanks for the fix! |
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.
Compiled formatting into a
char*buffer produces42)forstd::variant<int>{42}instead ofvariant(42).std::expectedandstd::unexpectedhave the same issue: their prefixes advance the local iterator, but the nested formatter receives the original context output position.Advance the context to that iterator in
write_escaped_alternativebefore calling the nested formatter. Add regression tests for all three wrappers, nested variants, monostate, returned output positions with surrounding text, and unchanged string/character escaping.Validation on upstream
mainat9197f51593dab5f637454a8889fb9638e737711a, using GCC 15.1.0 (MinGW) and CMake 4.3.2:compile-testandstd-testpass (2/2); C++23-only expected cases are not exercised in this configuration.git diff --checkpass.Linux, MSVC, and older compiler configurations have not been run locally.