| Issue |
174822
|
| Summary |
False positive `-Winvalid-noreturn` if `throw` is followed by `try`/`catch`
|
| Labels |
clang:diagnostics,
false-positive
|
| Assignees |
|
| Reporter |
aaronpuchert
|
Compile with `-fsyntax-only -Winvalid-noreturn`:
```c++
[[noreturn]] void test() {
throw 1;
try {} catch(...) {}
}
```
This produces:
```
<source>: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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs