Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The type of width and precision arguments is not validated at compile-time #1715

Closed
HolyBlackCat opened this issue Jun 4, 2020 · 1 comment

Comments

@HolyBlackCat
Copy link

Those two lines:

fmt::format(FMT_STRING("{:{}}"), 12.3, "");
fmt::format(FMT_STRING("{:.{}}"), 12.3, "");

both compile and throw exceptions at runtime, due to width/precision argument type not being integral.

Since other similar problems are diagnosed at compile-time when using FMT_STRING, it should probably happen here as well.

@vitaut
Copy link
Contributor

vitaut commented Jul 23, 2022

Done in 48e0a59. Thanks for catching this.

@vitaut vitaut closed this as completed Jul 23, 2022
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

No branches or pull requests

2 participants