You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
switch to "-std=c++17" to see it working (no consteval)
last "good" fmt-version : 11.0.2
first "failed" fmt-version: 11.1.0
The text was updated successfully, but these errors were encountered:
jolz
changed the title
arg_id with fmt::arg() ans width specifier stopped compiling (since fmt 11.1.0)
arg_id with fmt::arg() and width specifier stopped compiling (since fmt 11.1.0)
Feb 13, 2025
@vitaut Are you sure this is a duplicate of #3817 ? I'm seeing this same compilation error in this sample. It seems related to dynamic formatting with named arguments. Surprisingly, switching to a runtime format string works.
fmt::format("{a:<{size}}", fmt::arg("a", 1), fmt::arg("size", 10)); // Fails to compile.fmt::format("{a:{size}}", fmt::arg("a", 1), fmt::arg("size", 10)); // Fails to compile.fmt::format("{a:<10}", fmt::arg("a", 1), fmt::arg("size", 10)); // Compiles and formats correctly.fmt::format("{:<{}}", 1, 10); // Compiles and formats correctly.fmt::format("{0:<{1}}", 1, 10); // Compiles and formats correctly.fmt::format(fmt::runtime("{a:<{size}}"), fmt::arg("a", 1), fmt::arg("size", 10)); // Compiles and formats correctly.
Things work in 11.0.2, but compile fails in 11.1.3 in VS 17.14 Preview 1.
here's my sample code (based on https://fmt.dev/dev/syntax/ "Box drawing using Unicode fill")
compile error message with fmt-trunk and -std=c++20:
The text was updated successfully, but these errors were encountered: