jvoung wrote:

> I don't think we can ignore a TU simply because it has the Google Test header 
> included, which this will do. This would ignore real problems, such as

That is true (and we've considered that -- FWIW, ymand and our team have been 
maintaining this checker).
But as is, we are currently seeing many false positives in test files, and it 
becomes harder for developers to spot such true positives, given the FP noise 
to filter through.

Would it help if this was instead a checker option?

> The issue with the Google Test macros seems to be, that the dataflow check 
> does not understand using a helper for the cast to `bool` like this:
> 
> ```c++
> ...
>         if (const auto wrapped_check = Converter{v})
>             ;
>         else
>             return;
>     auto val = *v;
> }
> ```

Thanks, that's definitely part of it. If we handle `EXPECT_TRUE` as well (and 
other `EXPECT_...` forms), EXPECT [does not](https://godbolt.org/z/6Tbxae9jq) 
have a `return` so would need special handling (otherwise looks like both 
branches go to the `*v`).


https://github.com/llvm/llvm-project/pull/115051
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to