Closed tt4g closed 1 year ago
This was a bug in an earlier version that didn't match the standard spec (missing format string validation). It is mentioned in the changelog although somewhat briefly:
Improved validation of format specifiers for
std::chrono::duration
(https://github.com/fmtlib/fmt/issues/3219, https://github.com/fmtlib/fmt/pull/3232).
Thanks for letting me know.
I ask this question to clarify the cause of the spdlog library issue (gabime/spdlog#2735).
After updating the fmt version from 9.1.0 to 10.0.0 in spdlog library, the following code now causes "invalid format" error. fmt 10 is not yet available for selection in Compiler Explorer, so I am checking the behavior with the latest sources.
Compiler Explorer
I could not find the relevant spec change in the version 10 CHANGELOG. However, looking at the
chrono_specs
, it appears that left hand side literals were not allowed.https://fmt.dev/10.0.0/syntax.html#chrono-format-specifications
Change the code as follows and the error will no longer occur with fmt 10.
In fmt 9.1.0 and earlier, literals could appear on the left hand side of
chrono_specs
. However, I am aware that the behavior from fmt 10 is correct. Is this correct?