Remove const qualification in compile-time checks

This commit is contained in:
Jack Andersen
2019-07-14 16:16:13 -10:00
committed by Victor Zverovich
parent da2d33f1f1
commit 699fe8e711
2 changed files with 11 additions and 1 deletions

View File

@@ -1854,6 +1854,14 @@ TEST(FormatTest, CompileTimeString) {
EXPECT_EQ("foo", fmt::format(FMT_STRING("{}"), string_like()));
}
TEST(FormatTest, CustomFormatCompileTimeString) {
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), Answer()));
Answer answer;
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), answer));
const Answer const_answer;
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), const_answer));
}
#if FMT_USE_USER_DEFINED_LITERALS
// Passing user-defined literals directly to EXPECT_EQ causes problems
// with macro argument stringification (#) on some versions of GCC.