False positive `-Winvalid-noreturn` if `throw` is followed by `try`/`catch`
Open
clang:diagnostics
confirmed
false-positive
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Compile with `-fsyntax-only -Winvalid-noreturn`:
```c++
[[noreturn]] void test() {
throw 1;
try {} catch(...) {}
}
```
This produces:
```
:4:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
4 | }
| ^
```
I think that's because we don't add exception handling edges for calls to the CFG, so we mark all catch blocks as reachable. But this is just speculation.
Contributor guide
Assessment
This issue has not been assessed yet.