There is usage of absl::optional<bool> in Chromium such as
base::Value::FindBoolKey (and similar functions). The goal is to allow returning a base::nullopt value if the key is not found, or a bool with the correct value otherwise. I think this is a valid use case for absl::optional<bool> (though error prone).
The subject has already been discussed on this list in
past thread, the summary was:
1. if possible use an enum with three possible values "undefined", "yes", "no" if possible,
2. prefer using `has_value()` or `value_or(default)` instead of dependending on the conversion, and limit scope of the optional,
3. google style and internal google code do not ban optional<bool> though they point they are error prone.
I think having a clang plugin warning for the use of `absl::optional<bool>::operator bool() const` would be a good idea since we have alternatives (.has_value() / .or_value(default)). I am not sure a presubmit would be possible as there are valid use cases for absl::optional<bool>.
-- Sylvain