Annotate FMT_USE_RTTI #endif directives

Add trailing "// FMT_USE_RTTI" comments to the matching #endif lines to make
the conditional-compilation blocks easier to follow.
This commit is contained in:
Victor Zverovich
2026-07-17 12:12:25 -07:00
parent 7852fc384c
commit b5d1e5404b
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -649,7 +649,7 @@ struct formatter<
*out++ = ':'; *out++ = ':';
*out++ = ' '; *out++ = ' ';
} }
#endif #endif // FMT_USE_RTTI
out = detail::write_bytes<char>(out, string_view(ex.what())); out = detail::write_bytes<char>(out, string_view(ex.what()));
#if FMT_USE_RTTI #if FMT_USE_RTTI
// If the exception carries a nested exception (e.g. via // If the exception carries a nested exception (e.g. via
@@ -666,7 +666,7 @@ struct formatter<
} }
} }
} }
#endif #endif // FMT_USE_RTTI
return out; return out;
} }
}; };
+3 -3
View File
@@ -429,7 +429,7 @@ TEST(std_test, exception) {
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
EXPECT_EQ("level 1: level 2: level 3", fmt::format("{}", ex)); EXPECT_EQ("level 1: level 2: level 3", fmt::format("{}", ex));
} }
#endif #endif // FMT_USE_RTTI
} }
TEST(std_test, exception_ptr) { TEST(std_test, exception_ptr) {
@@ -462,7 +462,7 @@ TEST(std_test, exception_ptr) {
p3 = std::current_exception(); p3 = std::current_exception();
} }
EXPECT_EQ(fmt::format("{}", p3), "outer: inner"); EXPECT_EQ(fmt::format("{}", p3), "outer: inner");
#endif #endif // FMT_USE_RTTI
} }
#if FMT_USE_RTTI #if FMT_USE_RTTI
@@ -470,7 +470,7 @@ TEST(std_test, type_info) {
EXPECT_EQ(fmt::format("{}", typeid(std::runtime_error)), EXPECT_EQ(fmt::format("{}", typeid(std::runtime_error)),
"std::runtime_error"); "std::runtime_error");
} }
#endif #endif // FMT_USE_RTTI
#if FMT_USE_BITINT #if FMT_USE_BITINT
FMT_PRAGMA_CLANG(diagnostic ignored "-Wbit-int-extension") FMT_PRAGMA_CLANG(diagnostic ignored "-Wbit-int-extension")