summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2015-06-19 18:13:19 +0000
committerDouglas Gregor <dgregor@apple.com>2015-06-19 18:13:19 +0000
commitb4866e85e5ffa0d352d496958582f0983172dc01 (patch)
treebfc790bef93a450379f8936f20589b99a524657b /clang/lib/Sema/SemaDeclObjC.cpp
parentbb3a01cfaf679413b5e9ee3f3187e06bb246dcf3 (diff)
downloadbcm5719-llvm-b4866e85e5ffa0d352d496958582f0983172dc01.tar.gz
bcm5719-llvm-b4866e85e5ffa0d352d496958582f0983172dc01.zip
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. llvm-svn: 240153
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud