diff --git a/libcxx/test/std/time/time.syn/formatter_tests.h b/libcxx/test/std/time/time.syn/formatter_tests.h --- a/libcxx/test/std/time/time.syn/formatter_tests.h +++ b/libcxx/test/std/time/time.syn/formatter_tests.h @@ -70,6 +70,9 @@ std::cerr << "\nFormat string " << fmt << "\nExpected exception " << what << "\nActual exception " << e.what() << '\n'; assert(e.what() == what); +# else + (void)what; + (void)e; # endif return; } @@ -92,10 +95,9 @@ std::basic_string_view{fmt}, std::make_format_args>(arg)); #ifndef TEST_HAS_NO_EXCEPTIONS } catch (const std::format_error& e) { -# if defined(_LIBCPP_VERSION) + (void)e; if constexpr (std::same_as) std::cerr << "\nFormat string " << fmt << "\nUnexpected exception " << e.what() << '\n'; -# endif assert(false); } #endif