Files
clang-p2996/clang/lib/Analysis/ReachableCode.cpp
Haojian Wu a73baf620b [coroutine] Suppress unreachable-code warning on coroutine statements. (#77454)
This fixes #69219.

Consider an example:

```
CoTask my_coroutine() {
    std::abort();
    co_return 1; // unreachable code warning.
}
```

Clang emits a CFG-based unreachable warning on the `co_return` statement
(precisely the `1` subexpr). If we remove this statement, the program
semantic is changed (my_coroutine is not a coroutine anymore).

This patch fixes this issue by never considering coroutine statements as
dead statements.
2024-02-05 08:55:27 +01:00

27 KiB