Cleanup macros
This commit is contained in:
@@ -222,13 +222,13 @@ if (CMAKE_CXX_STANDARD GREATER_EQUAL 20)
|
||||
|
||||
# Compile-time argument name check
|
||||
expect_compile(format-string-name "
|
||||
#if defined(FMT_HAS_CONSTEVAL) && FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
#if defined(FMT_HAS_CONSTEVAL) && FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
using namespace fmt::literals;
|
||||
fmt::print(\"{foo}\", \"foo\"_a=42);
|
||||
#endif
|
||||
")
|
||||
expect_compile(format-string-name-error "
|
||||
#if defined(FMT_HAS_CONSTEVAL) && FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
#if defined(FMT_HAS_CONSTEVAL) && FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
using namespace fmt::literals;
|
||||
fmt::print(\"{foo}\", \"bar\"_a=42);
|
||||
#else
|
||||
|
||||
@@ -187,7 +187,7 @@ TEST(compile_test, named) {
|
||||
EXPECT_THROW(fmt::format(FMT_COMPILE("{invalid}"), fmt::arg("valid", 42)),
|
||||
fmt::format_error);
|
||||
|
||||
# if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
# if FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
using namespace fmt::literals;
|
||||
auto statically_named_field_compiled =
|
||||
fmt::detail::compile<decltype("arg"_a = 42)>(FMT_COMPILE("{arg}"));
|
||||
@@ -285,7 +285,7 @@ TEST(compile_test, print) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
TEST(compile_test, compile_format_string_literal) {
|
||||
using namespace fmt::literals;
|
||||
EXPECT_EQ("", fmt::format(""_cf));
|
||||
|
||||
+2
-2
@@ -1837,7 +1837,7 @@ TEST(format_test, compile_time_string) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), 42));
|
||||
EXPECT_EQ("foo", fmt::format(FMT_STRING("{}"), string_like()));
|
||||
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
using namespace fmt::literals;
|
||||
EXPECT_EQ("foobar", fmt::format(FMT_STRING("{foo}{bar}"), "bar"_a = "bar",
|
||||
"foo"_a = "foo"));
|
||||
@@ -2182,7 +2182,7 @@ TEST(format_test, format_string_errors) {
|
||||
# else
|
||||
fmt::print("warning: constexpr is broken in this version of MSVC\n");
|
||||
# endif
|
||||
# if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
# if FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
using namespace fmt::literals;
|
||||
EXPECT_ERROR("{foo}", "named argument is not found", decltype("bar"_a = 42));
|
||||
EXPECT_ERROR("{foo}", "named argument is not found",
|
||||
|
||||
Reference in New Issue
Block a user