Skip to content

Commit 2e0c6bc

Browse files
committed
[libc++][hardening] Update documentation in the light of P3878.
With P3878 applied to the Standard, a Hardened implementation is no longer allowed to use the `observe` semantic (the new wording requires a terminating semantic to be used); update the documentation to note that using `observe` is same as `ignore`, i.e., does not result in a conforming Hardened implementation.
1 parent f7fff18 commit 2e0c6bc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

libcxx/docs/Hardening.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,11 @@ Notes:
305305
behavior; the ``observe`` semantic is meant to make adopting hardening easier
306306
but should not be used outside of the adoption period;
307307
- C++26 wording for Library Hardening precludes a conforming Hardened
308-
implementation from using the Contracts ``ignore`` semantic when evaluating
309-
hardened preconditions in the Library. Libc++ allows using this semantic for
310-
hardened preconditions, but please be aware that using ``ignore`` does not
311-
produce a conforming "Hardened" implementation, unlike the other semantics
312-
above.
308+
implementation from using a Contracts' non-terminating semantic (i.e.,
309+
``ignore`` or ``observe``) when evaluating hardened preconditions in the
310+
Library. Libc++ allows using these semantics for hardened preconditions, but
311+
please be aware that using ``ignore`` or ``observe`` does not produce
312+
a conforming "Hardened" implementation, unlike the terminating semantics above.
313313

314314
The default assertion semantics are as follows:
315315

libcxx/include/__config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ _LIBCPP_HARDENING_MODE_DEBUG
193193
// Notes:
194194
// - Continuing execution after a hardening check fails results in undefined behavior; the `observe` semantic is meant
195195
// to make adopting hardening easier but should not be used outside of this scenario;
196-
// - C++26 wording for Library Hardening precludes a conforming Hardened implementation from using the Contracts
197-
// `ignore` semantic when evaluating hardened preconditions in the Library. Libc++ allows using this semantic for
198-
// hardened preconditions, however, be aware that using `ignore` does not produce a conforming "Hardened"
199-
// implementation, unlike the other semantics above.
196+
// - C++26 wording for Library Hardening precludes a conforming Hardened implementation from using a Contracts'
197+
// non-terminating semantic (i.e., `ignore` or ``observe``) when evaluating hardened preconditions in the Library.
198+
// Libc++ allows using these semantics for hardened preconditions, however, be aware that using `ignore` or `observe`
199+
// does not produce a conforming "Hardened" implementation, unlike the terminating semantics above.
200200
// clang-format off
201201
# define _LIBCPP_ASSERTION_SEMANTIC_IGNORE (1 << 1)
202202
# define _LIBCPP_ASSERTION_SEMANTIC_OBSERVE (1 << 2)

0 commit comments

Comments
 (0)