[PATCH] D157554: [NFC][Clang] Fix static analyzer concern about null pointer dereference
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 10 10:22:17 PDT 2023
aaron.ballman added a comment.
In D157554#4576720 <https://reviews.llvm.org/D157554#4576720>, @eandrews wrote:
> In D157554#4576478 <https://reviews.llvm.org/D157554#4576478>, @aaron.ballman wrote:
>
>> This feels a bit more like a functional change than a non-functional change because it seems like we should be able to test this case (whereas, if we think `TC` can never be null in reality, we could add an `assert` for it and not add test coverage). That said, I'm not certain how to induce a failure here. Adding @erichkeane in case he has ideas.
>
> Yea I agree. I see that this is inside `ReturnTypeRequirement.isTypeConstraint()` so maybe `Param` should always have a type constraint? I'm just naively guessing here though
As I read the code, I think an assert is sufficient -- if the param is a type constraint, I believe we expect a non-null type constraint and a null one is a sign of a bug.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157554/new/
https://reviews.llvm.org/D157554
More information about the cfe-commits
mailing list