<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/146223>146223</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
False negative Wmissing-noreturn warning when a function always throws
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TiborGY
</td>
</tr>
</table>
<pre>
Unlike GCC, Clang's implementation of -Wmissing-noreturn does not fire when seeing a function that always throws:
```
void throwError(const std::string& msg){
throw std::runtime_error(msg);
}
```
GCC 15.1 issues the following warning:
`warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]`
https://godbolt.org/z/nWPjxb377
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkUkGPmzwQ_TXDZZQIhhjCgUM2-djrd2i16qkyMAFvjR3ZQ9Ltr69Ispt2KyEhy2_ee_P8dIxmcMw1qCdQh0TPMvpQfzGtD8_fktb3b_VXZ80Pxuf9HmiPe6vdAFRGNNPJ8sROtBjv0B9x9TKZGI0bVs4Hljk47D1HdF7waALjZWSHkdm4ATUeZ9ddR2XUgtpe9FtEGYO_RMh3kO6gSO9fujt7098u_wvBB6Bt510UjNIv4HwXJZjFWYFTHIAqKJ8WirS6Dj1wYXZiJv7Od5o7Or-iy8Mn2ef9HjO1ztDEOPNij_HorfWXZYeLDm4RfXf7OD-Wm8wwCraMnXa96bUsBAG1SDDtLIxA5XtcQCWCelq9xHkYOMrqAwX54QOkDjdvkO5GkdM1LGqAmsH3rbey9mEAan4BNe7l_9efbV6WSV_nfZVXOuE6K1WWkdqmlIz1hrhqdam42G7KvsqqrNMVbY95kbVlp7LE1JSSSgvaZkqlKa1VVhXc90V33BRVyQVsUp60sWtrz9OinVyzqrNNQZQnVrds47VgRI4vtySBaOlbqJehVTsPETapNVHig0aMWK4bbSOj40GLOTP-W7F76Ldy_dGqvwqVzMHWn9IyMs7tuvMTULOI3n-rU_Cv3AlQc3t0oOa-y7mm3wEAAP__KQUKGQ">