[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:39:39 PST 2021


zoecarver updated this revision to Diff 320938.
zoecarver added a comment.

- Add newline to UsingLibcxx.rst


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/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/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.320938.patch
Type: text/x-patch
Size: 1449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210202/9207f46a/attachment.bin>


More information about the libcxx-commits mailing list