| 1 |
.. title:: clang-tidy - bugprone-multiple-statement-macro |
| 2 |
|
| 3 |
bugprone-multiple-statement-macro |
| 4 |
================================= |
| 5 |
|
| 6 |
Detect multiple statement macros that are used in unbraced conditionals. Only |
| 7 |
the first statement of the macro will be inside the conditional and the other |
| 8 |
ones will be executed unconditionally. |
| 9 |
|
| 10 |
Example: |
| 11 |
|
| 12 |
.. code-block:: c++ |
| 13 |
|
| 14 |
#define INCREMENT_TWO(x, y) (x)++; (y)++ |
| 15 |
if (do_increment) |
| 16 |
INCREMENT_TWO(a, b); // (b)++ will be executed unconditionally. |