mirror of
https://github.com/fmtlib/fmt.git
synced 2026-05-05 20:14:11 +02:00
Disable unsafe implicit conversion to std::string (#729)
This commit is contained in:
@@ -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"; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user