Go to file
Devin Coughlin 5a3843e506 [analyzer] Nullability: Look through implicit casts when suppressing warnings on return.
In r256567 I changed the nullability checker to suppress warnings about returning a null
value from a function/method with a non-null return type when the type of the returned
expression is itself nonnull. This enables the programmer to silence nullability warnings
by casting to _Nonnull:

  return (SomeObject * _Nonnull)nil;

Unfortunately, under ObjC automated reference counting, Sema adds implicit casts to
_Nonnull to return expressions of nullable or unspecified types in functions with
non-null function/method return types. With r256567, these casts cause all nullability
warnings for returns of reference-counted types to be suppressed under ARC, leading to
false negatives.

This commit updates the nullability checker to look through implicit casts before
determining the type of the returned expression. It also updates the tests to turn on
ARC for the nullability_nullonly.mm testfile and adds a new testfile to test when ARC
is turned off.

rdar://problem/24200117

llvm-svn: 258061
2016-01-18 18:53:33 +00:00
clang [analyzer] Nullability: Look through implicit casts when suppressing warnings on return. 2016-01-18 18:53:33 +00:00
clang-tools-extra [clang-tidy] Fix a copy-paste error. 2016-01-15 16:16:47 +00:00
compiler-rt [asan] Optionally print reproducer cmdline in ASan reports. 2016-01-18 07:55:12 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc AMDGPU: Add aliases for all VI targets 2015-12-15 18:37:04 +00:00
libcxx Tame a -Wunknown-attributes warning 2016-01-13 23:27:08 +00:00
libcxxabi Revert r256322 (and follow-up 256323), the test it added does not pass on OS X. 2016-01-15 15:44:14 +00:00
libunwind Replace cmake check for printf with a check for fopen. 2015-12-10 00:47:08 +00:00
lld Only emit files with subsections_via_symbols if all inputs had that set. 2016-01-16 01:09:23 +00:00
lldb Remove skipIfLinuxClang decorator 2016-01-18 15:01:14 +00:00
llgo [llgo] Force exporting __morestack from llgoi 2015-11-27 04:46:46 +00:00
llvm [llvm-readobj][ELF] s/dyn_rela_/dyn_rel_/ No functional changes. 2016-01-18 18:52:04 +00:00
openmp Don't use __DATE__ or __TIME__; it breaks release builds (PR26145) 2016-01-14 23:18:20 +00:00
polly Do not check JSON alignment of scalar accesses 2016-01-15 16:49:33 +00:00