[libcxx-commits] [PATCH] D95821: [docs] Explain noexcept policy for narrow contracts.
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 2 15:38:39 PST 2021
zoecarver updated this revision to Diff 320936.
zoecarver added a comment.
Herald added a subscriber: arphaman.
- Address review comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95821/new/
https://reviews.llvm.org/D95821
Files:
libcxx/docs/DesignDocs/NoexceptPolicy.rst
libcxx/docs/UsingLibcxx.rst
libcxx/docs/index.rst
Index: libcxx/docs/index.rst
===================================================================
--- libcxx/docs/index.rst
+++ libcxx/docs/index.rst
@@ -173,6 +173,7 @@
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>`_
Index: libcxx/docs/UsingLibcxx.rst
===================================================================
--- libcxx/docs/UsingLibcxx.rst
+++ libcxx/docs/UsingLibcxx.rst
@@ -345,4 +345,4 @@
* ``search``
* ``unique``
* ``upper_bound``
-* ``lock_guard``'s constructors
+* ``lock_guard``'s constructors
\ No newline at end of file
Index: libcxx/docs/DesignDocs/NoexceptPolicy.rst
===================================================================
--- /dev/null
+++ libcxx/docs/DesignDocs/NoexceptPolicy.rst
@@ -0,0 +1,18 @@
+====================
+``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).
+
+Before version 13, libc++ did not specify whether a function that did not
+throw would be marked as ``noexcept``, so users should not rely on any
+non-throwing functions to be marked ``noexcept`` (unless the Standard
+specifies it).
\ No newline at end of file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95821.320936.patch
Type: text/x-patch
Size: 1777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210202/7fbd1354/attachment-0001.bin>
More information about the libcxx-commits
mailing list