Skip to content

Commit ae0a272

Browse files
committed
Address feedback: update documentation, marka test unsupported in C++03.
1 parent f613fde commit ae0a272

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

libcxx/docs/Hardening.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,20 @@ following options to the compiler:
328328
All the :ref:`same notes <notes-for-users>` apply to setting this macro as for
329329
setting ``_LIBCPP_HARDENING_MODE``.
330330

331+
Notes for vendors
332+
-----------------
333+
334+
Similarly to hardening modes, vendors can set the default assertion semantic by
335+
providing ``LIBCXX_ASSERTION_SEMANTIC`` as a configuration option, with the
336+
possible values of ``hardening_dependent``, ``ignore``, ``observe``,
337+
``quick_enforce`` and ``enforce``. The default value is ``hardening_dependent``
338+
which is a special value that instructs the library to select the semantic based
339+
on the hardening mode in effect (the mapping is described in
340+
:ref:`the main section on assertion semantics <assertion-semantics>`).
341+
342+
This option controls both the assertion semantic that the precompiled library is
343+
built with and the default assertion semantic that users will build with.
344+
331345
.. _override-assertion-handler:
332346

333347
Overriding the assertion failure handler
@@ -447,6 +461,13 @@ The first character of an ABI tag encodes the hardening mode:
447461
- ``d`` -- [d]ebug mode;
448462
- ``n`` -- [n]one mode.
449463

464+
The second character of an ABI tag encodes the assertion semantic:
465+
466+
- ``i`` -- [i]gnore semantic;
467+
- ``o`` -- [o]bserve semantic;
468+
- ``q`` -- [q]uick-enforce semantic;
469+
- ``e`` -- [e]nforce semantic.
470+
450471
Hardened containers status
451472
==========================
452473

libcxx/test/extensions/libcxx/odr_signature.assertion_semantics.sh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
// ABI tags have no effect in MSVC mode.
1010
// XFAIL: msvc
1111

12-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
12+
// Assertion semantics are not supported in C++03 mode
13+
// UNSUPPORTED: std=c++03
1314

1415
// Test that we encode the assertion semantic in an ABI tag to avoid ODR violations when linking TUs that have different
1516
// values for it.
1617

17-
// Note that GCC doesn't support `-Wno-macro-redefined`.
1818
// RUN: %{cxx} %s %{flags} %{compile_flags} -c -DTU1 -U_LIBCPP_ASSERTION_SEMANTIC -D_LIBCPP_ASSERTION_SEMANTIC=_LIBCPP_ASSERTION_SEMANTIC_IGNORE -o %t.tu1.o
1919
// RUN: %{cxx} %s %{flags} %{compile_flags} -c -DTU2 -U_LIBCPP_ASSERTION_SEMANTIC -D_LIBCPP_ASSERTION_SEMANTIC=_LIBCPP_ASSERTION_SEMANTIC_OBSERVE -o %t.tu2.o
2020
// RUN: %{cxx} %s %{flags} %{compile_flags} -c -DTU3 -U_LIBCPP_ASSERTION_SEMANTIC -D_LIBCPP_ASSERTION_SEMANTIC=_LIBCPP_ASSERTION_SEMANTIC_QUICK_ENFORCE -o %t.tu3.o

0 commit comments

Comments
 (0)