From b5d1e5404bd678df41f20d0f053222a6c60fe74b Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 17 Jul 2026 12:12:25 -0700 Subject: [PATCH] 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. --- include/fmt/std.h | 4 ++-- test/std-test.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/fmt/std.h b/include/fmt/std.h index 18b12abc..379b186e 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -649,7 +649,7 @@ struct formatter< *out++ = ':'; *out++ = ' '; } -#endif +#endif // FMT_USE_RTTI out = detail::write_bytes(out, string_view(ex.what())); #if FMT_USE_RTTI // If the exception carries a nested exception (e.g. via @@ -666,7 +666,7 @@ struct formatter< } } } -#endif +#endif // FMT_USE_RTTI return out; } }; diff --git a/test/std-test.cc b/test/std-test.cc index 8fb92f79..6fc92938 100644 --- a/test/std-test.cc +++ b/test/std-test.cc @@ -429,7 +429,7 @@ TEST(std_test, exception) { } catch (const std::exception& ex) { EXPECT_EQ("level 1: level 2: level 3", fmt::format("{}", ex)); } -#endif +#endif // FMT_USE_RTTI } TEST(std_test, exception_ptr) { @@ -462,7 +462,7 @@ TEST(std_test, exception_ptr) { p3 = std::current_exception(); } EXPECT_EQ(fmt::format("{}", p3), "outer: inner"); -#endif +#endif // FMT_USE_RTTI } #if FMT_USE_RTTI @@ -470,7 +470,7 @@ TEST(std_test, type_info) { EXPECT_EQ(fmt::format("{}", typeid(std::runtime_error)), "std::runtime_error"); } -#endif +#endif // FMT_USE_RTTI #if FMT_USE_BITINT FMT_PRAGMA_CLANG(diagnostic ignored "-Wbit-int-extension")