[clang-tools-extra] [clang-tidy] Filter out googletest TUs in bugprone-unchecked-optional-access (PR #115051)

Jan Voung via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 13:39:34 PST 2024


jvoung wrote:

> A quick middle-point solution is to add an option to allow ignoring code that is executed from within macros, or even allow the user to specify which macros to ignore.

Unfortunately, the problem is exactly that we're not (fully) understanding the content of `ASSERT_TRUE` and related macros (`ASSERT_FALSE`, `ASSERT_THAT(..., IsTrue(opt.has_value()))`, etc.), which then affect code outside and following the macros. So, ignoring them would not solve anything. Until we can understand the googletest macros, there is little value in check any tests that use them. That is what this patch accomplishes.


https://github.com/llvm/llvm-project/pull/115051


More information about the cfe-commits mailing list