[libcxx-commits] [libcxx] fab1948 - [lic++][docs] Explain noexcept policy for narrow contracts.
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Feb 5 11:27:46 PST 2021
Author: zoecarver
Date: 2021-02-05T11:27:19-08:00
New Revision: fab194898b5ed79d458813885af1187f57bb0a33
URL: https://github.com/llvm/llvm-project/commit/fab194898b5ed79d458813885af1187f57bb0a33
DIFF: https://github.com/llvm/llvm-project/commit/fab194898b5ed79d458813885af1187f57bb0a33.diff
LOG: [lic++][docs] Explain noexcept policy for narrow contracts.
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
Added:
libcxx/docs/DesignDocs/NoexceptPolicy.rst
Modified:
libcxx/docs/index.rst
Removed:
################################################################################
diff --git a/libcxx/docs/DesignDocs/NoexceptPolicy.rst b/libcxx/docs/DesignDocs/NoexceptPolicy.rst
new file mode 100644
index 000000000000..8dc5e14e486e
--- /dev/null
+++ b/libcxx/docs/DesignDocs/NoexceptPolicy.rst
@@ -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).
diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst
index c3bf8f8c1ce4..7946eade0e56 100644
--- a/libcxx/docs/index.rst
+++ b/libcxx/docs/index.rst
@@ -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>`_
More information about the libcxx-commits
mailing list