Disable unsafe implicit conversion to std::string (#729)

This commit is contained in:
Victor Zverovich
2018-05-19 07:14:13 -07:00
parent d2bf93fe22
commit d940fa679c
4 changed files with 13 additions and 15 deletions
-10
View File
@@ -1072,16 +1072,6 @@ TEST(FormatterTest, FormatStdStringView) {
}
#endif
struct ConvertibleToString {
std::string s;
ConvertibleToString() : s("foo") {}
operator const std::string &() const { return s; }
};
TEST(FormatterTest, FormatConvertibleToString) {
EXPECT_EQ("foo", format("{}", ConvertibleToString()));
}
struct ConvertibleToStringView {
operator fmt::string_view() const { return "foo"; }
};