Clang-tidy bugprone-unchecked-optional-access doesn't work when #including <iox/optional.hpp>
Open
clang-tidy
clang:dataflow
false-negative
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
I just tried this code with clang-tidy built from main and noticed that `bugprone-unchecked-optional-access` doesn't work. If I comment out the `#include ` then it works as expected.
```
#include
#include
int foo(std::optional& val)
{
return *val;
}
```
Verified that this doesn't work with LLVM 21.1.5 as well (i.e. the check doesn't detect the unsafe dereference)
Contributor guide
Assessment
This issue has not been assessed yet.