<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/151501>151501</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] -Wunreachable-code is unexpectedly triggered by expressions in the `noexcept` operator
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics,
false-positive
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
frederick-vs-ja
</td>
</tr>
</table>
<pre>
Code ([Godbolt link](https://godbolt.org/z/ja195jY13)):
```C++
template<int I, class T>
void get(T&&) {}
void test() {
int n{};
[[maybe_unused]] constexpr bool V = noexcept(::get<0>(n)) && noexcept(::get<1>(n));
}
```
Warning message:
```
<source>:6:73: warning: code will never be executed [-Wunreachable-code]
6 | [[maybe_unused]] constexpr bool V = noexcept(::get<0>(n)) && noexcept(::get<1>(n));
| ^~~~~~~~
1 warning generated.
Compiler returned: 0
```
This doesn't seem to be regression.
I _think_ this is false-positive as the operands of `noexcept` are always unevaluated, and we may want to calculate later `noexcept`-expressions for convenience.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMVMGO6yYU_ZrrzVUiDGM7XnjhJC_V24_61NUIw43DDIEIcDLpot9eYWfa92bUfdFVEsHh5JxzARmjGR1RB9UWqn0hp3TyoTsG0hSMeltd4-pVFoPX927nNSHwDVTb37wevE1ojXuDag98c0rpEkH0wA_AD-OyvvZhBH74E_jhVZZt9fpHKYC3uUQPbK6aLbUDvs3F-kTni5WJQOyMS_gd-A6VlTHiM4hvwPqrNxpHSsA3z8DruVqEZgvNfmGdEYlihnyssR4x87kHUCxTs_HtWd4HepncFElnQ9UelXcx0fsl4OC9xd8RxB6dp3dFl5lX9CD6LEPsWBbGN24xh4uo_wKXv4AXHQ_lH2EsLn7I4Iwb8UwxypEemf2MEbvop6AoM4q-BtE3AkSPt2Vn_qly127GWnR0pYADIb2TmhLp7H31Y3KBpDrJwdIqg7P9HAxijdDs_icB4TwWPd_-WgawvvywiiM5CjKRXgPrd_58MZYCBkpTcKRzEuxrws8nE1F7ig54kzASnTH5nFGgMVCMxrv1Av2OL-lk3NsLprzJRDxKG2l18dEkcyWUEdOJ0F8oSKcj-iNCzf6xWDOUgVDam7xHnBxdpZ2y3ny8pdN4IzzLO96kS1mDklZN-Rpg_gifuFY590VfxKMPuRlXcoaconWhO6Fb0cqCurKpRFuLum6LU9fUolViaPSRFD1Vm6YhIUkwOVRV3VRVYTrOeMUaUZacNU_tulatOLaNbATbUNUweGJ0lsaurb2e8_UuTIwTdWVVVqwsrBzIxvkx4VxZOR9BbeTofExGReAc-A44_zW7PF3ti9Bl1tUwjRGemDUxxX__J5lk52dqoa32-PXo5q5Mjt4vpBJpe8cUzDhSII3DHX-OzLi5WZ8aNPcu-VBMwXafXjSTTtOwVv4M_JBFPb5Wl-BfSSXghzmJCPzwCOPa8b8DAAD__y2to44">