[PATCH] D154221: [analyzer] Fix false negative when pass implicit cast nil to nonnull
Balázs Benics via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 4 23:01:10 PDT 2023
steakhal accepted this revision.
steakhal added a comment.
This revision is now accepted and ready to land.
I'd say, as tests pass and I and @xazax.hun think that this is an improvement - along with you - then we should merge this as-is and do corrections once reported.
================
Comment at: clang/test/Analysis/nullability-arc.mm:25
[self foo:nil];
+ // expected-warning at -1{{nil passed to a callee that requires a non-null 1st parameter}}
----------------
tripleCC wrote:
> I think there should be a warning when we call the foo: method
I'm probably a bit naive, but it feels like passing `nil` to a function that expects `_Nonnull` seems like a precondition violation no matter if `objc-arc` is enabled or not. TBH I'm not even sure how that comes into play in this context in the first place.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154221/new/
https://reviews.llvm.org/D154221
More information about the cfe-commits
mailing list