Make FMT_COMPILE fallback on runtime without if constexpr (#2261)
This commit is contained in:
1 parent
0cd0fb9184
commit
355be4b13f
2 files changed
+11
-1
No files matched your search
@@ -155,6 +155,12 @@ TEST(CompileTest, EmptyFormatString) {
|
||||
EXPECT_EQ(fmt::format(f), "");
|
||||
}
|
||||
|
||||
TEST(CompileTest, CompileFallback) {
|
||||
// FMT_COMPILE should fallback on runtime formatting when `if constexpr` is
|
||||
// not available.
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), 42));
|
||||
}
|
||||
|
||||
#ifdef __cpp_if_constexpr
|
||||
TEST(CompileTest, FormatDefault) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), 42));
|
||||
|
||||
Reference in new issue
Block a user