Alcaro wrote:

Yes, std::expected would be a false positive. But how would you tell apart 
std::expected, where a falsey object still contains something usable, from 
std::unique_ptr, where it does not?

One option would be simply ignore that - this warning applies to raw pointers 
only, not even integers. It can always be expanded later, if we can think of 
how.

> I think we should just straight-up error on it (or at least make it a warning 
> that defaults to an error)

I wouldn't get my hopes up, not until [forgetting a return 
statement](https://godbolt.org/z/nKooafrGK) errors by default.

Though I do agree both _should_ error by default.

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

Reply via email to