<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60417>60417</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] bugprone-unchecked-optional-access ignores assert and assume
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Febbe
</td>
</tr>
</table>
<pre>
The check does not consider implicit checks like `__assume` or `assert` which explicitly tell that this value should not be uninitialized.
For example, the following code snipped will rise a warning.
```
for (std::optional<down_sampling::work::sample_down>&& job : jobv) { //
assert(job);
job->do_something();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUstu6zgM_Rp6QySQJb-y8CJtmi-YfSBZrK1WlgxRbtr5-oGdFIMLXIAATfpQh4-jmd0YiHqoX6C-FHrNU0z9lYyhwkT70_8zEQ4TDZ9oIzGGmHGIgZ2lhG5evBtcfgAYvfskhEbcbpp5nQkagTFtGc1MKW_xfXLDhPT9qPQ_mMl7zJPOmCfH-KX9SshTXL3d2QzhGlxw2Wnv_iV7BHEBcb7GhPSt58UTyFfME-F79D7eXRhxiJaQg1sWsnh33mNyTKjxrlNwYXy-AY142h4ivm_dyo6zBXUGdY5LdjFoD-rVxnu48cbnwvj4e4_p8_G15-m2YUC9gWxANvgRDYI6b_4L5AmhfUFEBHnd7MH43IvsPqIBeQL18tsKbnUHUG823jjOlKeNV3Z_oqC9_HWUwvbKntRJF9SXTVuXrZR1W0y9llX3LowmErqtqDO1GKqTFkaQNZUUheulkEqUqiyValV1rCo6UdMJUXbUKKqhEjRr54_ef83HmMbCMa_UN6Iq28JrQ55_5ZT6DXQw68hQCe848_9l2WW_C2_wOoyH7OwP1Bc067ikGOiwhl1WZA-_ZzjoYSBmdGOIifi5PdTB4kNwxZp8P-W88HaXfdGjy9NqjkOcQV437qc7LCl-0JBBXvf-GeR1H-G_AAAA__9HbvjY">