You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We encountered false-positive warnings of the check bugprone-unchecked-optional-access involving a ternary operator and an access either via a (shared) pointer or an iterator.
The following example demonstrates these cases, it is also available here: https://godbolt.org/z/4zo3xn6Tx
Just using a smart pointer without the ternary also gives the false positive. godbolt
#include<memory>
#include<optional>intmain() {
std::shared_ptr<std::optional<int>> s = std::make_shared<std::optional<int>>(3);
if (s && s->has_value())
int v1 = s->value();
}
We encountered false-positive warnings of the check bugprone-unchecked-optional-access involving a ternary operator and an access either via a (shared) pointer or an iterator.
The following example demonstrates these cases, it is also available here: https://godbolt.org/z/4zo3xn6Tx
The warnings are:
The text was updated successfully, but these errors were encountered: