[lic++][docs] Explain noexcept policy for narrow contracts.
authorzoecarver <z.zoelec2@gmail.com>
Fri, 5 Feb 2021 19:24:38 +0000 (11:24 -0800)
committerzoecarver <z.zoelec2@gmail.com>
Fri, 5 Feb 2021 19:27:19 +0000 (11:27 -0800)
Adds documentation around libc++'s policy to add noexcept to things that cannot throw but aren't marked as noexcept.

Refs LWG 3518 and D95251.

Differential Revision: https://reviews.llvm.org/D95821

libcxx/docs/DesignDocs/NoexceptPolicy.rst [new file with mode: 0644]
libcxx/docs/index.rst

diff --git a/libcxx/docs/DesignDocs/NoexceptPolicy.rst b/libcxx/docs/DesignDocs/NoexceptPolicy.rst
new file mode 100644 (file)
index 0000000..8dc5e14
--- /dev/null
@@ -0,0 +1,13 @@
+====================
+``noexcept`` Policy
+====================
+
+Extended applications of ``noexcept``
+------------------------------------------
+
+As of version 13 libc++ may mark functions that do not throw (i.e.,
+"Throws: Nothing") as ``noexcept``. This has two primary consequences:
+first, functions might not report precondition violations by throwing.
+Second, user-provided functions, such as custom predicates or custom
+traits, which throw might not be propagated up to the caller (unless
+specified otherwise by the Standard).
index c3bf8f8..7946ead 100644 (file)
@@ -173,6 +173,7 @@ Design Documents
    DesignDocs/FeatureTestMacros
    DesignDocs/ExtendedCXX03Support
    DesignDocs/UniquePtrTrivialAbi
+   DesignDocs/NoexceptPolicy
 
 * `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_
 * `<type_traits> design <http://libcxx.llvm.org/type_traits_design.html>`_