[clang-tidy] readability-simplify-boolean-expr should handle if statements with init statements
Open
clang-tidy
enhancement
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
**Problem:** `readability-simplify-boolean-expr` doesn't simplify conditions in if statements with init statements.
**Examples:**
- `if (auto x = f(); x != nullptr)` → `if (auto x = f())`
- `if (bool b = g(); b == true)` → `if (bool b = g())`
**Request:** Extend the check to handle C++17 if-with-initializer syntax.
Contributor guide
Assessment
This issue has not been assessed yet.