Issue |
131507
|
Summary |
[clang-tidy] Check request: `readability-redundant-braces-nesting`
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
vbvictor
|
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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs