<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56096>56096</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang emits `-Wnullability-completeness` warnings on `weak` Objective-C properties
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:diagnostics,
            objective-c
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mwyman
      </td>
    </tr>
</table>

<pre>
    Zeroing weak pointers are by definition `nullable`; adding `nullable` should not be required to satisfy `-Wnullability-completeness` checks when nullability is already satisfied by definition.

Additionally, the fix-it hints provided by the warning suggest both non-idiomatic Objective-C (adding `_Nullable` to the pointer type rather than in the `@property` attributes) and suggests an option of adding `_Nonnull` (adding either `nonnull` or `_Nonnull` will yield a mutual-exclusivity error).

```
Test/nullability-completeness-weak.h:10:28: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
@property(nonatomic, weak) id<Delegate> delegate;
                           ^
Test/nullability-completeness-weak.h:10:39: note: insert '_Nullable' if the pointer may be null
@property(nonatomic, weak) id<Delegate> delegate;
                                      ^
                                        _Nullable
Test/nullability-completeness-weak.h:10:39: note: insert '_Nonnull' if the pointer should never be null
@property(nonatomic, weak) id<Delegate> delegate;
                                      ^
                                        _Nonnull
```

Suggested fix: https://reviews.llvm.org/D128031
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVcuu0zAQ_Zp0M0qVR19ZZHFvC0tYgITEBjnxNBlw7GI7Lfl7xml628LlIYSQqKLEj8z4nDOT08rIoXyP1pBu4ITiExx46NE6EBahGkDinjR5MhqiVaJ7pUSlkIdR_ghCyhB4vwGuNb2SoI2HCsHi554sSvAGnPDk9kMIiN-dQ0iRH-LadAeFHjU6F1LULdafHJxa1HDzHhDjUhaFHKZcxInvUM6jZBclD-f7A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