Files
clang-p2996/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
songruiwang b22a5d4617 [analyzer] Fix false negative when pass implicit cast nil to nonnull
We should look through implicit casts before determining the type of the arguments, and only allow explicit cast to _Nonnull to suppress warning

```
void foo(NSString *_Nonnull);

foo((NSString * _Nonnull)nil); // no-warning
id obj = nil;
foo(obj); // should warning here (implicit cast id to NSString *_Nonnull)

```

Reviewed By: xazax.hun, steakhal

Differential Revision: https://reviews.llvm.org/D154221
2023-07-06 22:36:51 +08:00

53 KiB