From 3eee9fc2c4d1973904b1a26fa96a8c7473ef6a5e Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Tue, 29 Jul 2025 00:19:15 -0700 Subject: [libc++][hardening] Introduce assertion semantics. (#149459) Assertion semantics closely mimic C++26 Contracts evaluation semantics. This brings our implementation closer in line with C++26 Library Hardening (one particular benefit is that using the `observe` semantic makes adopting hardening easier for projects). --- libcxxabi/src/demangle/DemangleConfig.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libcxxabi') diff --git a/libcxxabi/src/demangle/DemangleConfig.h b/libcxxabi/src/demangle/DemangleConfig.h index a88e6ce65d70..79dbeb89cc28 100644 --- a/libcxxabi/src/demangle/DemangleConfig.h +++ b/libcxxabi/src/demangle/DemangleConfig.h @@ -19,6 +19,14 @@ #include "../abort_message.h" #endif +#ifndef _LIBCPP_LOG_HARDENING_FAILURE +// Libc++abi does not have any functionality to log and continue, so we drop +// error messages when we build the demangler with `observe` assertion semantic. +// Once the layering with libc++ is improved, this could use the libc++ +// functionality to log hardening failures. +#define _LIBCPP_LOG_HARDENING_FAILURE(message) ((void)0) +#endif + #include #ifdef _MSC_VER -- cgit v1.2.3