xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/bugprone/multiple-statement-macro.rst (revision 6e566bc5523f743bc34a7e26f050f1f2b4d699a8)
1.. title:: clang-tidy - bugprone-multiple-statement-macro
2
3bugprone-multiple-statement-macro
4=================================
5
6Detect multiple statement macros that are used in unbraced conditionals. Only
7the first statement of the macro will be inside the conditional and the other
8ones will be executed unconditionally.
9
10Example:
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.
17