]> granicus.if.org Git - clang/commit
Fix inference of _Nullable for weak Objective-C properties.
authorDouglas Gregor <dgregor@apple.com>
Fri, 9 Oct 2015 20:36:17 +0000 (20:36 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 9 Oct 2015 20:36:17 +0000 (20:36 +0000)
commit998a58abd76a6835b6ddb863899f40e9ff0ebf33
treeb24da43fa0b77bf4cce20ca00e15f7745ce64089
parent77a45a46c8c230894d8e3177a6fee66c1b950d6f
Fix inference of _Nullable for weak Objective-C properties.

The inference of _Nullable for weak Objective-C properties was broken
in several ways:

* It was back-patching the type information very late in the process
  of checking the attributes for an Objective-C property, which is
  just wrong.
* It was using ad hoc checks to try to suppress the warning about
  missing nullability specifiers (-Wnullability-completeness), which
  didn't actual work in all cases (rdar://problem/22985457)
* It was inferring _Nullable even outside of assumes-nonnull regions,
  which is wrong.

Putting the inference of _Nullable for weak Objective-C properties in
the same place as all of the other inference logic fixes all of these
ills.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249896 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaObjCProperty.cpp
lib/Sema/SemaType.cpp
test/SemaObjC/arc-unavailable-for-weakref.m
test/SemaObjC/nullable-weak-property.m
test/SemaObjCXX/Inputs/nullability-consistency-2.h
test/SemaObjCXX/Inputs/nullability-consistency-6.h