<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/90162>90162</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][static analyzer]alpha.deadcode.UnreachableCode false positive on cxxTryStmt
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:static analyzer
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mzyKi
</td>
</tr>
</table>
<pre>
```cpp
class BaseException {};
class DerivedException : public BaseException {};
void foo();
void f4() {
try {
foo();
} catch (BaseException &b) {
} catch (DerivedException &d) {
}
}
```
When I run ```clang-tidy --allow-enabling-analyzer-alpha-checkers -checks=-*,clang-analyzer-alpha.deadcode.UnreachableCode test.cpp```, the result like as following:
```bash
test.cpp:8:3: warning: This statement is never executed [clang-analyzer-alpha.deadcode.UnreachableCode]
8 | try {
| ^~~~~
9 | foo();
| ~~~~~~
10 | } catch (BaseException &b) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 | } catch (DerivedException &d) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 | }
| ~
test.cpp:8:3: note: This statement is never executed
8 | try {
| ^~~~~
9 | foo();
| ~~~~~~
10 | } catch (BaseException &b) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 | } catch (DerivedException &d) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 | }
| ~
```
I think this is false positive. If not , I am not clear about reason.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVc2OozgQfhpzKYHAQGgOHJJmIkV73Fnt2diV4G3HRrbJJHPIs6-A_AzT6Z5uaVeaKHJsV9VXP1-lzJyTO41YkXxF8jpgvW-NrfbfT3_IoDHiVJFFPH1515G4JvESgCvmHKyYwy9Hjp2XRgMpVqSoSbq6KM11a7TygOIH9XQJXd8oyX-BcwM6GClgawyhT4SWbypkk3zEuQgAvD3NL-AhEgApauDM8xYIffopMLpoXgHP9F8nSRfikcm1RNfdrcaX47j-3aKGDdhew50DxfQu9FKcIAyZUuZbiJo1SupdyDRTp-9oQ6a6loW8Rf6C1sG0cyStQ0KXhD5PIHP1SCAT3AiM_tIWGW9Zo_DZCASPzkcD97cY6TP4FsGi65UHJV8QmIOtGcKRekfS5Y9p3Owa5trp6gaZLp9IukyHXvjGrJ6M4WsrHTjPPO5Re5AONB7QAh6R9x4FkHz1qRxIXt_L_wSkeH7cEoOA5F_O5_P5fl1e9N_qGLjJz-eZZRJfJJ_tqSvi-Z3P3UvyyMvHOnFy9J6bmSd69_QK421itfH4EVY_zBD89xz9jwz9Vvy8M2024FupX4bVDeRsmXIInXHSywNGsNkOTMLw598A248HrpBZYI3pPVhkzuho5mdcA1GlokxLFmCVFEmWxLTI8qCtMNmmxTZDFJwJjk2eLjAWiySnJec5KwNZ0ZhmcUYXcZqWcR6JLC0yLJKkyZItZhnJYtwzqSKlDvvI2F0gneuxKuNkQQPFGlRufNgoHecFSZdDA0oO18FBKB1ePVsNCGHT7xzJYiWdd3dML70a38cJI69JvvoZJq9_MUXn5QSjgR-PX-3pT7_3QW9V1XrfuWF00jWh6530bd9E3OwJXQ-RXH7Czpp_kHtC12OqjtD1mO2_AQAA___Bf0rm">