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

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 16:00:28 PST 2024


https://github.com/5chmidti commented:

> option that is off by default. For all other users the behavior is unchanged, but we can opt in on our side.
> Can we add the option to use in the meantime, while I work on the macro handling in parallel?

That sounds okay to me, even though the option is expected to be removed again because it won't be needed then. Others may have stronger opinions on this, so lets see.

A less fine-grained solution to skip these FPs would be to create a `.clang-tidy` inside test directories with `InheritParentConfig` enabled, and exclude the check there. Though that would mean that, e.g., test utils would be skipped that do not contain the macro.

---

While you're at it, maybe add the catch2 and doctest `REQUIRE` macro as well? This could of course mean that the option may not be removed later if only the GTest macros are handled, which could be complex enough without implementing the `REQUIRE` macro as well.

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


More information about the cfe-commits mailing list