Skip to content

Commit fd7e46b

Browse files
authored
Revert "[libc++] Remove trailing newline from _LIBCPP_ASSERTION_HANDLER calls" (#144615)
Reverts #143573
1 parent f25f2f7 commit fd7e46b

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

libcxx/include/__assert

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#define _LIBCPP_ASSERT(expression, message) \
2121
(__builtin_expect(static_cast<bool>(expression), 1) \
2222
? (void)0 \
23-
: _LIBCPP_ASSERTION_HANDLER( \
24-
__FILE__ ":" _LIBCPP_TOSTRING(__LINE__) ": assertion " _LIBCPP_TOSTRING(expression) " failed: " message))
23+
: _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(__LINE__) ": assertion " _LIBCPP_TOSTRING( \
24+
expression) " failed: " message "\n"))
2525

2626
// WARNING: __builtin_assume can currently inhibit optimizations. Only add assumptions with a clear
2727
// optimization intent. See https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609 for a

libcxx/src/verbose_abort.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) noexcept {
3030
va_list list;
3131
va_start(list, format);
3232
std::vfprintf(stderr, format, list);
33-
// Callers of `__libcpp_verbose_abort` do not include a newline but when
34-
// writing the message to stderr we need to include one.
35-
std::fputc('\n', stderr);
3633
va_end(list);
3734
}
3835

libcxx/test/support/check_assertion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void std::__libcpp_verbose_abort(char const* format, ...) noexcept {
340340

341341
std::fprintf(stderr, "%s\n", Marker);
342342
std::vfprintf(stderr, format, args);
343-
std::fprintf(stderr, "\n%s", Marker);
343+
std::fprintf(stderr, "%s", Marker);
344344

345345
va_end(args);
346346

0 commit comments

Comments
 (0)