]> granicus.if.org Git - clang/commit
[analyzer] Nullability: Suppress diagnostic on bind with cast.
authorDevin Coughlin <dcoughlin@apple.com>
Wed, 13 Apr 2016 17:59:24 +0000 (17:59 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Wed, 13 Apr 2016 17:59:24 +0000 (17:59 +0000)
commit1eb408116bbfa3856e471f917c0901864607064b
tree88f383557359d6b91ea6db08792c09d33d850b6f
parent8a4cb5943adc2e54a86134616da9cdde00851cab
[analyzer] Nullability: Suppress diagnostic on bind with cast.

Update the nullability checker to allow an explicit cast to nonnull to
suppress a warning on an assignment of nil to a nonnull:

id _Nonnull x = (id _Nonnull)nil; // no-warning

This suppression as already possible for diagnostics on returns and
function/method arguments.

rdar://problem/25381178

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266219 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
test/Analysis/nullability.mm