<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62884>62884</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Extend bugprone-unused-return-value to all functions with specific return types.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy,
check-request
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
royjacobson
</td>
</tr>
</table>
<pre>
Return types like `std::expected`, `std::error_code`, `boost::system::error_code`, `absl::Status` etc indicate an error might happen. It would be nice to have a way to force people into handling those return values (or at least explicitly ignore them).
Abseil declares `absl::Status` as a `[[nodiscard]]` class which achieves the same goal, but it seems nearly impossible to get existing STL classes to opt in to this extension.
Rust has the `unused_must_use` diagnostic for this coding style.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U12PpDYQ_DXmpTUjjxnI7AMPe7cZKVKe7vK-MnYP9J2xibu9u_z7yHDR6aREQny4oMpVXVhmmiLioLpPqntpbJE55SGn7Zt1aeQUmzH5bfiCUnIE2VZkCPQdQfWaxav2WbXP-LGiE_Sq18p8_hXKOeVXlzz-BMeUWA6YNxZc_v9VO3I40K9ipbDqNaA4oOjJWUGwEfbvYKFpFpjtumI8wx8C76kEDyNCJIcgCWb7hmDh3W716ZGyQ1gxrQGB4o5HHyhOIHNihHxYfrOhIIMyt5TBCgS0LIAfayBHEjagKaaMIDMuyjydlX5R-vk4P4-MFMCjCzZXkv82ZBlsxfYZfIrJEzubvepe6tFrcMEyw_tMbgbrZsI35CoIbBeEKdlQ4xqLAAkw4sIQ0ea6uWVNzDSGPYEJ686Jpbr8-tefB3HlSpBWAYr1TmZiwA_ByJTiL4a-FK4ZH-Kq1yUWRv-6FJbXwnVu4MlOMbGQqxEfZC75qsiyBfzB1_ih9U_tk21wuPS36-3adpeumQe0Xdveust4vVr98Lrt9O2B7WgcXvVvrmtoMNq0ujPtxeju0p1Hq7199Pry6NvWdDd11bhYCucQ3pZzylNDzAWH3txu1ybYEQPvfTfGBRunk5DflDHKfK5LM7rvp4x_F2Spq91Lk4dKdRrLxOqqA7HwT3IhCTj8XvPyMJZpzSni6UjmdJTotJeoZmtDgEeJTihFhneSGXhFRw9y_xZu_8fOTclhmEVWrm0xd2XuE8lcxrNLizL3Kv_jclpz-oZOlLnvRlmZ--71nwAAAP__--FIMQ">