Skip to content

Commit 93dfb6c

Browse files
var-consttru
authored andcommitted
Address feedback
1 parent 815cd72 commit 93dfb6c

File tree

4 files changed

+14
-27
lines changed

4 files changed

+14
-27
lines changed

libcxx/docs/Hardening.rst

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,9 @@ to control the level by passing **one** of the following options to the compiler
7474
pre-built components. Most libc++ code is header-based, so a user-provided
7575
value for ``_LIBCPP_HARDENING_MODE`` will be mostly respected.
7676

77-
.. warning::
78-
79-
Assertion semantics are currently an experimental feature.
80-
81-
.. note::
82-
83-
Assertion semantics are not available in the C++03 mode.
84-
8577
In some cases, users might want to override the assertion semantic used by the
8678
library. This can be done similarly to setting the hardening mode; please refer
87-
to the :ref:`relevant section <assertion-semantics>`. Note that this feature is
88-
currently experimental.
79+
to the :ref:`relevant section <assertion-semantics>`.
8980

9081
Notes for vendors
9182
-----------------
@@ -275,17 +266,9 @@ output. This is less secure and increases the size of the binary (among other
275266
things, it has to store the error message strings) but makes the failure easier
276267
to debug. It also allows testing the error messages in our test suite.
277268

278-
.. warning::
279-
280-
Assertion semantics are currently an experimental feature.
281-
282-
.. note::
283-
284-
Assertion semantics are not available in the C++03 mode.
285-
286-
Experimentally, this default behavior can be customized by users via
287-
:ref:`assertion semantics <assertion-semantics>`; it can also be completely
288-
overridden by vendors by providing a :ref:`custom assertion failure handler
269+
This default behavior can be customized by users via :ref:`assertion semantics
270+
<assertion-semantics>`; it can also be completely overridden by vendors by
271+
providing a :ref:`custom assertion failure handler
289272
<override-assertion-handler>`.
290273

291274
.. _assertion-semantics:
@@ -295,11 +278,11 @@ Assertion semantics
295278

296279
.. warning::
297280

298-
Assertion semantics are currently an experimental feature.
281+
Assertion semantics are currently an experimental feature.
299282

300283
.. note::
301284

302-
Assertion semantics are not available in the C++03 mode.
285+
Assertion semantics are not available in the C++03 mode.
303286

304287
What happens when an assertion fails depends on the assertion semantic being
305288
used. Four assertion semantics are available, based on C++26 Contracts

libcxx/include/__config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ _LIBCPP_HARDENING_MODE_DEBUG
201201
# else
202202
# if !_LIBCPP_HAS_EXPERIMENTAL_LIBRARY
203203
# error "Assertion semantics are an experimental feature."
204-
# endif // ! _LIBCPP_HAS_EXPERIMENTAL_LIBRARY
204+
# endif
205205
# if defined(_LIBCPP_CXX03_LANG)
206206
# error "Assertion semantics are not available in the C++03 mode."
207-
# endif // defined(_LIBCPP_CXX03_LANG)
207+
# endif
208208

209209
# endif // _LIBCPP_ASSERTION_SEMANTIC
210210

libcxx/include/__cxx03/__config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ _LIBCPP_HARDENING_MODE_EXTENSIVE, \
152152
_LIBCPP_HARDENING_MODE_DEBUG
153153
# endif
154154

155+
# ifdef _LIBCPP_ASSERTION_SEMANTIC
156+
# error "Assertion semantics are not available in the C++03 mode."
157+
# endif
158+
155159
// } HARDENING
156160

157161
# define _LIBCPP_TOSTRING2(x) #x

libcxx/vendor/llvm/default_assertion_handler.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# pragma GCC system_header
2626
#endif
2727

28-
#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
28+
#if defined(_LIBCPP_CXX03_LANG) && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
2929

3030
// Keep the old implementation that doesn't support assertion semantics for backward compatibility with the frozen C++03
3131
// mode.
@@ -59,6 +59,6 @@ _LIBCPP_ASSERTION_SEMANTIC_ENFORCE
5959

6060
# endif // _LIBCPP_ASSERTION_SEMANTIC == _LIBCPP_ASSERTION_SEMANTIC_IGNORE
6161

62-
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
62+
#endif // defined(_LIBCPP_CXX03_LANG) && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
6363

6464
#endif // _LIBCPP___ASSERTION_HANDLER

0 commit comments

Comments
 (0)