Open
Description
These docs suggest it will recognize macros like D/CHECK and ASSERT_THAT.
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/unchecked-optional-access.html#ensure-that-a-value-exists-using-common-macros
But I don't believe it actually recognizes the macro names. It only seems to work if the checker is able to expand the macro to a return statement or stdlib assertion.
See this example: https://godbolt.org/z/xPKvqT9qv
- Pass:
CHECK_ASSERT
, callingassert
fromassert.h
- Pass:
CHECK_RETURN
, directly returning before value access - Fail:
CHECK
, calling an extern handler- I'm interested in this case, with different handlers for embedded and for unit tests.
For some more supporting evidence, there are no examples of this in the checker's unit tests.