fmt icon indicating copy to clipboard operation
fmt copied to clipboard

Dynamic precision for `nested_formatter` does not work

Open tobiasleibner opened this issue 1 year ago • 1 comments

When changing the struct Point example explaining nested_formatter-usage in the API reference to use dynamic precision, execution fails with an error

Execution build compiler returned: 0
Program returned: 139
terminate called after throwing an instance of 'fmt::v10::format_error'
  what():  precision is not integer
Program terminated with signal: SIGSEGV

Reproducer on godbolt: https://godbolt.org/z/srYqdvnEb

tobiasleibner avatar Feb 20 '24 08:02 tobiasleibner

Thanks for reporting. The problem is that the wrong format context is being used in the nested format call. We'll need to tweak the API a bit to synchronize contexts.

vitaut avatar Mar 19 '24 02:03 vitaut