[libc++] Remove full header path from assertion messages (#190060)

This creates additional bloat in programs or debug info, without much
additional value beyond just the file name.

Fixes #190058
This commit is contained in:
Louis Dionne 2026-04-25 07:01:30 -04:00 committed by GitHub
parent 2f28e1db53
commit 0ad0e899d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,7 @@
#define _LIBCPP_ASSERT(expression, message) \
(__builtin_expect(static_cast<bool>(expression), 1) \
? (void)0 \
: _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING( \
: _LIBCPP_ASSERTION_HANDLER(__FILE_NAME__ ":" _LIBCPP_TOSTRING( \
__LINE__) ": libc++ Hardening assertion " _LIBCPP_TOSTRING(expression) " failed: " message "\n"))
// WARNING: __builtin_assume can currently inhibit optimizations. Only add assumptions with a clear