Skip to content

Commit 2c3e35e

Browse files
author
Doug Wyatt
committed
Clarify the relationship with noexcept, add a reference to the RealtimeSanitizer docs.
1 parent 61464c0 commit 2c3e35e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

clang/docs/FunctionEffectAnalysis.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,15 @@ series of performance constraints. From weakest to strongest:
7878

7979
``nonblocking`` includes the ``nonallocating`` guarantee.
8080

81-
``nonblocking`` and ``nonallocating`` include the ``noexcept`` guarantee, but neither
82-
attribute implicitly specifies ``noexcept``. (It would be inappropriate for a Clang
83-
attribute, ignored by non-Clang compilers, to imply a standard language feature.) Nonetheless,
84-
Clang emits a warning if, in C++, a function is declared ``nonblocking`` or ``nonallocating``
85-
without ``noexcept``. This diagnostic is controlled by ``-Wperf-constraint-implies-noexcept``.
81+
While ``nonblocking`` and ``nonallocating`` are conceptually a superset of ``noexcept``, neither
82+
attribute implicitly specifies ``noexcept``. Further, ``noexcept`` has a specified runtime behavior of
83+
aborting if an exception is thrown, while the ``nonallocating`` and ``nonblocking`` attributes are
84+
purely for compile-time analysis and have no potential runtime behavior. Nonetheless, Clang emits a
85+
warning if, in C++, a function is declared ``nonblocking`` or ``nonallocating`` without
86+
``noexcept``. This diagnostic is controlled by ``-Wperf-constraint-implies-noexcept``.
87+
88+
Also, the ``nonblocking`` and ``blocking`` attributes do have special runtime behavior in code built
89+
with Clang's :doc:`RealtimeSanitizer`.
8690

8791
``nonblocking(true)`` and ``nonallocating(true)`` apply to function *types*, and by extension, to
8892
function-like declarations. When applied to a declaration with a body, the compiler verifies the

0 commit comments

Comments
 (0)