| 1 |
.. title:: clang-tidy - bugprone-assert-side-effect |
| 2 |
|
| 3 |
bugprone-assert-side-effect |
| 4 |
=========================== |
| 5 |
|
| 6 |
Finds ``assert()`` with side effect. |
| 7 |
|
| 8 |
The condition of ``assert()`` is evaluated only in debug builds so a |
| 9 |
condition with side effect can cause different behavior in debug / release |
| 10 |
builds. |
| 11 |
|
| 12 |
Options |
| 13 |
------- |
| 14 |
|
| 15 |
.. option:: AssertMacros |
| 16 |
|
| 17 |
A comma-separated list of the names of assert macros to be checked. |
| 18 |
|
| 19 |
.. option:: CheckFunctionCalls |
| 20 |
|
| 21 |
Whether to treat non-const member and non-member functions as they produce |
| 22 |
side effects. Disabled by default because it can increase the number of false |
| 23 |
positive warnings. |
| 24 |
|
| 25 |
.. option:: IgnoredFunctions |
| 26 |
|
| 27 |
A semicolon-separated list of the names of functions or methods to be |
| 28 |
considered as not having side-effects. Regular expressions are accepted, |
| 29 |
e.g. `[Rr]ef(erence)?$` matches every type with suffix `Ref`, `ref`, |
| 30 |
`Reference` and `reference`. The default is empty. If a name in the list |
| 31 |
contains the sequence `::` it is matched against the qualified typename |
| 32 |
(i.e. `namespace::Type`, otherwise it is matched against only |
| 33 |
the type name (i.e. `Type`). |