[libc++][hardening] Introduce assertion semantics (#148268) 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). NOKEYCHECK=True GitOrigin-RevId: 7345508c6febc57eaac985ef2fb14beabdc4d461
diff --git a/src/demangle/DemangleConfig.h b/src/demangle/DemangleConfig.h index 06fd223..7904e9d 100644 --- a/src/demangle/DemangleConfig.h +++ b/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 <version> #ifdef _MSC_VER