Remove the '0' chrono padding modifier from the docs - #4917
Merged
vitaut merged 1 commit intoSep 5, 2026
Conversation
The '0' modifier was documented in ca8eeb0 (fmtlib#3976) and the parser case for it was removed nine days later in 7bd11b5 ("Remove a redundant extension to reduce divergence from std::format"), which did not update the docs. Since then the grammar and the modifier table have promised a modifier that parse_chrono_format rejects with "invalid format", for all 11 of the presentation types the same section lists as supporting it. Zero padding remains the default, so the extension really was redundant; this only aligns the documentation with the code. Co-authored-by: Claude <noreply@anthropic.com>
vitaut
approved these changes
Sep 5, 2026
Contributor
|
Thank you! |
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.
doc/syntax.mddocuments a chrono padding modifier that the parser rejects.The grammar says
padding_modifier ::= "-" | "_" | "0"and the table below itlists a
'0'row, for the 11 presentation types the same section names(
H I M S U V W Y d j m). Butparse_chrono_formatonly has cases for'_'and
'-', so every%0spelling throwsformat_error: invalid format.Measured on
main(bc82c40), all 11 documented types,std::tmandstd::chrono::seconds, 44 cells:-_0The docs are the stale side, not the code.
ca8eeb09(#3976, 2024-05-30)added the
'0'grammar and table row;7bd11b5c(2024-06-08, nine dayslater) removed
case '0'and its tests under "Remove a redundant extensionto reduce divergence from std::format", touching only
chrono.handchrono-test.cc. Zero padding is the default, so it was redundant — thisjust drops the two stale mentions and notes the default.
Docs-only. The "only supported for" list is accurate: all 11 do honor
-and
_, checked with values short enough to discriminate.Drafted with Claude Code (
claude-opus-5); measurements and archaeology runand reviewed by me.