Check dynamic widht/precision id at compile time (#1614)

This commit is contained in:
Victor Zverovich
2020-04-22 14:18:45 -07:00
parent 2b75bd7ce6
commit 7d748a6f82
3 changed files with 23 additions and 14 deletions

View File

@@ -2493,6 +2493,8 @@ TEST(FormatTest, FormatStringErrors) {
EXPECT_ERROR("{:+}", "format specifier requires signed argument", unsigned);
EXPECT_ERROR("{:-}", "format specifier requires signed argument", unsigned);
EXPECT_ERROR("{: }", "format specifier requires signed argument", unsigned);
EXPECT_ERROR("{:{}}", "argument not found", int);
EXPECT_ERROR("{:.{}}", "argument not found", 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", bool);