mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-01 06:31:48 +01:00
Disallow passing non-string-literals to FMT_STRING
This commit is contained in:
@@ -1849,10 +1849,7 @@ TEST(FormatTest, UnpackedArgs) {
|
||||
struct string_like {};
|
||||
fmt::string_view to_string_view(string_like) { return "foo"; }
|
||||
|
||||
FMT_CONSTEXPR_DECL const char* format_str_ptr = "0123456789";
|
||||
|
||||
TEST(FormatTest, CompileTimeString) {
|
||||
EXPECT_EQ(format_str_ptr, fmt::format(FMT_STRING(format_str_ptr)));
|
||||
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), 42));
|
||||
EXPECT_EQ(L"42", fmt::format(FMT_STRING(L"{}"), 42));
|
||||
EXPECT_EQ("foo", fmt::format(FMT_STRING("{}"), string_like()));
|
||||
|
||||
Reference in New Issue
Block a user