Revert "[libc++] Remove trailing newline from _LIBCPP_ASSERTION_HANDLER calls" (#144615)

Reverts llvm/llvm-project#143573
This commit is contained in:
Daniel Thornburgh
2025-06-17 15:50:42 -07:00
committed by GitHub
parent f25f2f7de4
commit fd7e46b864
3 changed files with 3 additions and 6 deletions

View File

@@ -20,8 +20,8 @@
#define _LIBCPP_ASSERT(expression, message) \
(__builtin_expect(static_cast<bool>(expression), 1) \
? (void)0 \
: _LIBCPP_ASSERTION_HANDLER( \
__FILE__ ":" _LIBCPP_TOSTRING(__LINE__) ": assertion " _LIBCPP_TOSTRING(expression) " failed: " message))
: _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(__LINE__) ": assertion " _LIBCPP_TOSTRING( \
expression) " failed: " message "\n"))
// WARNING: __builtin_assume can currently inhibit optimizations. Only add assumptions with a clear
// optimization intent. See https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609 for a

View File

@@ -30,9 +30,6 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) noexcept {
va_list list;
va_start(list, format);
std::vfprintf(stderr, format, list);
// Callers of `__libcpp_verbose_abort` do not include a newline but when
// writing the message to stderr we need to include one.
std::fputc('\n', stderr);
va_end(list);
}

View File

@@ -340,7 +340,7 @@ void std::__libcpp_verbose_abort(char const* format, ...) noexcept {
std::fprintf(stderr, "%s\n", Marker);
std::vfprintf(stderr, format, args);
std::fprintf(stderr, "\n%s", Marker);
std::fprintf(stderr, "%s", Marker);
va_end(args);