Skip to content

Commit 0d91b05

Browse files
committed
[libc++][test] cleanup in formatter.h
* Silence warnings for unused parameters / variables * There's no reason to output unexpected exceptions only for libc++ Differential Revision: https://reviews.llvm.org/D141453
1 parent 8fd8a97 commit 0d91b05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libcxx/test/std/time/time.syn/formatter_tests.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ void check_exception([[maybe_unused]] std::string_view what,
7070
std::cerr << "\nFormat string " << fmt << "\nExpected exception " << what << "\nActual exception "
7171
<< e.what() << '\n';
7272
assert(e.what() == what);
73+
# else
74+
(void)what;
75+
(void)e;
7376
# endif
7477
return;
7578
}
@@ -92,10 +95,9 @@ void check_invalid_type(const std::set<std::basic_string_view<CharT>>& valid_typ
9295
std::basic_string_view<CharT>{fmt}, std::make_format_args<format_context<CharT>>(arg));
9396
#ifndef TEST_HAS_NO_EXCEPTIONS
9497
} catch (const std::format_error& e) {
95-
# if defined(_LIBCPP_VERSION)
98+
(void)e;
9699
if constexpr (std::same_as<CharT, char>)
97100
std::cerr << "\nFormat string " << fmt << "\nUnexpected exception " << e.what() << '\n';
98-
# endif
99101
assert(false);
100102
}
101103
#endif

0 commit comments

Comments
 (0)