[clang-tidy] detect unnecessary try-catch blocks
Open
check-request
clang-tidy
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```cpp
void cb() noexcept;
void f()
{
try {
cb();
} catch(...) {}
}
```
In this case the try-catch is unnecessary as nothing in the scope is throwing.
Contributor guide
Research direction
Start in the clang-tidy area and identify the existing checks and tests for exception handling or unnecessary constructs. Reproduce the issue's noexcept callback example, then determine the check's supported scope and add coverage showing that an unnecessary try-catch block is detected without flagging valid cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100