bugprone-unchecked-optional-access
does something even if no optional
implementation is available
#58097
Labels
bugprone-unchecked-optional-access
does something even if no optional
implementation is available
#58097
#57527 (comment) 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) thechromium
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
orllvm::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.
The text was updated successfully, but these errors were encountered: