[libcxx-commits] [libcxx] 0ad0e89 - [libc++] Remove full header path from assertion messages (#190060)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 25 04:01:34 PDT 2026


Author: Louis Dionne
Date: 2026-04-25T07:01:30-04:00
New Revision: 0ad0e899d456f824e520bfef7224a5f5bb2a7581

URL: https://github.com/llvm/llvm-project/commit/0ad0e899d456f824e520bfef7224a5f5bb2a7581
DIFF: https://github.com/llvm/llvm-project/commit/0ad0e899d456f824e520bfef7224a5f5bb2a7581.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/include/__assert

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__assert b/libcxx/include/__assert
index a9451daf47f2f..2ecd310553e71 100644
--- a/libcxx/include/__assert
+++ b/libcxx/include/__assert
@@ -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


        


More information about the libcxx-commits mailing list