diff options
author | Douglas Gregor <dgregor@apple.com> | 2015-06-19 18:13:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2015-06-19 18:13:19 +0000 |
commit | 1bfd760890a3349d7350ae87e53f9700e1e924f8 (patch) | |
tree | 71ce8b6cd2af00682e67f9eac9a9540559ab82f7 /test/Index/comment-objc-decls.m | |
parent | b33e4990d019ce591152189d9f39eea34e0059fb (diff) |
Diagnose unsafe uses of nil and __nonnull pointers.
This generalizes the checking of null arguments to also work with
values of pointer-to-function, reference-to-function, and block
pointer type, using the nullability information within the underling
function prototype to extend non-null checking, and diagnoses returns
of 'nil' within a function with a __nonnull return type.
Note that we don't warn about nil returns from Objective-C methods,
because it's common for Objective-C methods to mimic the nil-swallowing
behavior of the receiver by checking ostensibly non-null parameters
and returning nil from otherwise non-null methods in that
case.
It also diagnoses (via a separate flag) conversions from nullable to
nonnull pointers. It's a separate flag because this warning can be noisy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/comment-objc-decls.m')
0 files changed, 0 insertions, 0 deletions