Remove problematic constructibility check

This commit is contained in:
Victor Zverovich
2022-02-04 12:20:02 -08:00
parent 31e743d06e
commit 8a21e328b8
4 changed files with 22 additions and 15 deletions
+9 -3
View File
@@ -890,7 +890,10 @@ struct explicitly_convertible_to_string_view {
};
TEST(core_test, format_explicitly_convertible_to_string_view) {
EXPECT_EQ("foo", fmt::format("{}", explicitly_convertible_to_string_view()));
// Types explicitly convertible to string_view are not formattable by
// default because it may introduce ODR violations.
static_assert(
!fmt::is_formattable<explicitly_convertible_to_string_view>::value, "");
}
# ifdef FMT_USE_STRING_VIEW
@@ -899,8 +902,11 @@ struct explicitly_convertible_to_std_string_view {
};
TEST(core_test, format_explicitly_convertible_to_std_string_view) {
EXPECT_EQ("foo",
fmt::format("{}", explicitly_convertible_to_std_string_view()));
// Types explicitly convertible to string_view are not formattable by
// default because it may introduce ODR violations.
static_assert(
!fmt::is_formattable<explicitly_convertible_to_std_string_view>::value,
"");
}
# endif
#endif