clang-tidy - readability-inconsistent-ifelse-braces — Extra Clang Tools 22.1.8 documentation

# Extra Clang Tools 22.1.8 documentation

## clang-tidy - readability-inconsistent-ifelse-braces

# readability-inconsistent-ifelse-braces

Detects `if`/`else` statements where one branch uses braces and the other does not.

Before:

    if (condition) {
      statement;
    } else
      statement;

    if (condition)
      statement;

    if (condition)
      statement;
    else
      statement;

After:

    if (condition) {
      statement;
    } else {
      statement;
    }

    if (condition)
      statement;

    if (condition)
      statement;
    else
      statement;