Fix handling of implicit conversion to integral types larger than int

This commit is contained in:
Victor Zverovich
2018-02-01 16:42:15 -08:00
parent 08dff3774c
commit 1c7b751d70
2 changed files with 44 additions and 25 deletions
+8
View File
@@ -1078,6 +1078,14 @@ TEST(FormatterTest, FormatIntLocale) {
EXPECT_EQ("1,234,567", format("{:n}", 1234567));
}
struct ConvertibleToLongLong {
operator long long() const { return 1LL << 32; }
};
TEST(FormatterTest, FormatConvertibleToLongLong) {
EXPECT_EQ("100000000", format("{:x}", ConvertibleToLongLong()));
}
TEST(FormatterTest, FormatFloat) {
EXPECT_EQ("392.500000", format("{0:f}", 392.5f));
}