Fix handling of implicit conversion to integral types larger than int (#507)

(cherry picked from commit 07ed421521)
This commit is contained in:
Victor Zverovich authored and Jonathan Müller committed 2017-06-08 12:08:50 +02:00
1 parent 4fca31c497
commit 7859c3493f
2 files changed
+13 -8

No files matched your search

+10
View File
@@ -1234,6 +1234,16 @@ TEST(FormatterTest, FormatIntLocale) {
EXPECT_EQ("1--234--567", format("{:n}", 1234567));
}
struct ConvertibleToLongLong {
operator fmt::LongLong() const {
return fmt::LongLong(1) << 32;
}
};
TEST(FormatterTest, FormatConvertibleToLongLong) {
EXPECT_EQ("100000000", format("{:x}", ConvertibleToLongLong()));
}
TEST(FormatterTest, FormatFloat) {
EXPECT_EQ("392.500000", format("{0:f}", 392.5f));
}