diff options
| author | Konstantin Varlamov <varconsteq@gmail.com> | 2025-07-29 00:19:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-29 00:19:15 -0700 |
| commit | 3eee9fc2c4d1973904b1a26fa96a8c7473ef6a5e (patch) | |
| tree | f1bc07f289ea528448fc467c7b2f6ab84c81759f /libcxxabi | |
| parent | 59013d44058ef423a117f95092150e16e16fdb09 (diff) | |
[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).
Diffstat (limited to 'libcxxabi')
| -rw-r--r-- | libcxxabi/src/demangle/DemangleConfig.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 <version> #ifdef _MSC_VER |
