<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58097>58097</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`bugprone-unchecked-optional-access` does something even if no `optional` implementation is available
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132 indicates that `bugprone-unchecked-optional-access` is in the upper third in terms of heaviness. This applies even if your are not using optional at all since you require either C++17 (`std`), the abseil library (`absl::`) or (apparently) the `chromium` project (`base::`).
It should be smarter about this and not do anything if these objects are not available.
The list of the objects to be checked should probably be configurable as well allowing additional optional implementations to be supported. It doesn't support `Boost.Optional` or `llvm::Optional` which is a bit strange as those are probably more wide-spread than the currently supported custom implementations.
This configuration could also offer another way to mitigate this issue by supporting an empty list essentially disabling the check.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyllM2umzwQhq8GNlYQMYeQLFj0R5W66qY3MOBJ8PcZm9omEXff185PT7uqVAklZjyeeeeZMYNTWz_FuISi-VDIL3guOk7rUI1uxosx1-ffbvHuPx4jXnUIKwcs2q6VXSGbbMCJmW3c7WXTnZp230ihrdIjRQ4iThRFcaiH9YI4lnerHSce_2e1c0vUzpLZ0ThyCHASOuAozrBYl4U9VtqrbGI_B-HOYmK6agv3Snyf4E7LYjTy8JWt0GexudUL8iysi2IN2l7EM4-AEjJGwDhychSef6wavozSke1TIT_i2XeikEfICVHht5CnQn7KomgIrI0wevDkt4cXjCZBxJOdhfNpB8Igw0azJVs6je1x8m7W65xqfWB9RBko8PsoVVF_LuoP99-vUYTJrUaJgUWYyQMHxLg1JkKAYFWuVzksN5hQNVggaWDhhpQmvKDQlbShwfBvKb5DoNEhJsZJ7PNUdCnno2VPFZA-IMKWt5w968vqU0RBQdwYiIHZ3ZIKUko_6L_aoOfFcJoYSoZnioCOOxSmKvE1VcLBFrKLT3ui99G5EKtvjziJYUJ9qPOwZnbv926THqc0USQGjTjRk71kiXFy4JJ4vAqZHd5uWvEuLJ5Jpbm9D-K4-nsbfymELUQ3_1nIHzyR-cUm7eMtsSMTHCCfUwfRjjR3N9oShBmkLrg0957mqyWGV9pM0wqel7jdO4VLgNwarDehdEAdySdrTu2qSu73h8PbQeJWHkrVN-rUnKiMOhru__pKpk6I4Ga-j9XznlmXyLt3vH-nkcE_J61cvfmXr82xPnXl1NMI_ftOHt9YNdxS11I7EmxdJ-k8UolkbEJftLjG0vLtDhHrov1c6l7WUu7reo8P1bE9VEd5HlVzaHkY-STbunireYbiKumonL-Uvs-SACpgM0EPvzYpBH2xzDkd4tOKufL9GR-UG125zLn7rP0nJ2Davw">