<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/131507>131507</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] Check request: `readability-redundant-braces-nesting`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          vbvictor
      </td>
    </tr>
</table>

<pre>
    The check will detect when a developer left unintentional `{}` that does not provide any benefits to the code.
Usually this happens when `{}` used with `std::lock_guard` or similar RAII-wrappers.
e.g.

```cpp
// whole function has unnecessary '{}'
void example1() {
  {
     std::lock_guard l(m);
     // ...
  }
}

// end of function has unnecessary '{}'
void example2() {
  // ...
  {
     std::lock_guard l(m);
     // ...
 }
}
```

Note: in examples above, braces-nesting is redundant only if there are no variable shadowing in nested blocks.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykk8GOmzAQhp_GXEZBxhBIDhyyG0XaSw9Ve65sPIC7jk3tgZS3r5xk0-6qp1ayGAGe-b8Z-5cxmsEhtmz7xLbHTM40-tAuajEd-ZApr9f2y4jQjdi9wsVYCxoJO4LLiA4kaFzQ-gkDWOwJZmccoSPjnbTAas6aJ9YcWc2BRkmgPUZwnmAKfjEaQboVFDrsDUUgD5TEvMac8cPXOEtrV6DRRBjlNKGLN913heeIGi6GxvQ5kmblgZUH67vXb8Msg057fIBozsbKAJ8PLy-bS0jlQkwymA8ppFXz2-qmKb2KExMnuIzeIvSz61JbMMoIs3PYYYwyrMBEc2cRDeOHxRsN-FOeJ4sFEzsm9pD-8wM8IgD8hRMsE7szE3tWPrbdEfI8vxc4Jq7b8wGIToPv_4lQfCT8qPd_wO9434Z7Y__kCVl5AOPeWCJI5Rdk4hlUkB3GjcNIxg1gIgTUs9PSEXhnVzB9uikBQQYE52GRwUhlEeIotb9ckxykfNSgEnLMM92Wel_uZYZt0VSiELzaldnYima_62vBtRSoVaW7oikrrnq1031dV2VmWsHFlpdFXXBRiDLXaisq1etih53o-4pVHM_S2Nza5Zz7MGQmxhnboiy2vMmsVGjj1WRCdFa6YUNGr0yIZLrQpqyNmofIKm5NpPi7DhmyV3v-kbY9wvPVjwF_zBgpjZHVPKDUUhlraN08xrV5P0pW82wOth2JppjO83pcg6FxVnnnz0yckvQ9bKbgv2NHTJyu_UQmTveWllb8CgAA___Ro01I">