The docs state:
The check is aware of common macros like CHECK and DCHECK. Those can be used to ensure that an optional object has a value. For example:
But not every project uses CHECK or DCHECK. Would be nice if we could tell clang-tidy about our own checking macros (e.g. PROJECT_CHECK).
The alternative is to always silence clang-tidy because it doesn't understand our macros:
PROJECT_CHECK(optional.has_value()); optional->foo(); // NOLINT(bugprone-unchecked-optional-access)