Implement compile-time checks for dynamic width/precision type

This commit is contained in:
Victor Zverovich committed 2022-07-22 17:00:40 -07:00
1 parent bc5c7c50fd
commit 48e0a59222
3 files changed
+23 -3

No files matched your search

+1
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);