Skip to content

Fix argument count in dynamic stores with named arguments - #4933

Open
IfkumRfnl wants to merge 1 commit into
fmtlib:mainfrom
IfkumRfnl:fix/named-argument-count
Open

Fix argument count in dynamic stores with named arguments#4933
IfkumRfnl wants to merge 1 commit into
fmtlib:mainfrom
IfkumRfnl:fix/named-argument-count

Conversation

@IfkumRfnl

Copy link
Copy Markdown
Contributor

Summary

Code counted formatting arguments incorrectly when named arguments were present. It took the internal metadata slot as a formatting argument. Change made the math correct with

 return data_.size() - (named_info_.empty() ? 0 : 1);

i.e. subtracting 1 from the arguments vector count when named arguments are present which makes the counting correct. The corrected count is also used when constructing basic_format_args. Also regression tests were added.

@IfkumRfnl
IfkumRfnl requested a review from vitaut as a code owner September 6, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant