AaronBallman wrote:

> I can't for the life of me see a good way to use this. The `if(p)` pattern is 
> so common that no code base could ever turn on this warning. We could PERHAPS 
> check that we're in the process of checking a condition expression and 
> suppress this diagnostic, or recognize this pattern somehow, but without some 
> more work to make this more useful, I don't think we can accept this 
> diagnostic.

Given the amount of existing code out there which relies on pointer-to-bool 
conversions being well-defined, I don't think this makes sense as a compiler 
diagnostic. However, it could be a reasonable clang-tidy check as there are 
folks who find such code to be a type safety issue and they might want to have 
it diagnosed.

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

Reply via email to