Implement compile-time checks for dynamic width/precision type

This commit is contained in:
Victor Zverovich
2022-06-09 17:59:27 -07:00
parent bc5c7c50fd
commit 48e0a59222
3 changed files with 23 additions and 3 deletions

View File

@@ -2177,6 +2177,7 @@ TEST(format_test, format_string_errors) {
EXPECT_ERROR("{: }", "format specifier requires signed argument", unsigned);
EXPECT_ERROR("{:{}}", "argument not found", int);
EXPECT_ERROR("{:.{}}", "argument not found", double);
EXPECT_ERROR("{:{}}", "width/precision is not integer", int, double);
EXPECT_ERROR("{:.2}", "precision not allowed for this argument type", int);
EXPECT_ERROR("{:s}", "invalid type specifier", int);
EXPECT_ERROR("{:s}", "invalid type specifier", char);