[all-commits] [llvm/llvm-project] 34020d: Don't emit `-Wnullability-completeness` warnings o...

Michael Wyman via All-commits all-commits at lists.llvm.org
Thu Oct 20 22:43:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34020d39b8a116770aad0b5ad1a450e6e22da5cd
      https://github.com/llvm/llvm-project/commit/34020d39b8a116770aad0b5ad1a450e6e22da5cd
  Author: Michael Wyman <michael at mwyman.com>
  Date:   2022-10-20 (Thu, 20 Oct 2022)

  Changed paths:
    M clang/lib/Sema/SemaType.cpp
    M clang/test/SemaObjCXX/Inputs/nullability-consistency-2.h

  Log Message:
  -----------
  Don't emit `-Wnullability-completeness` warnings on `weak` Objective-C properties.

Zeroing weak references are by definition `nullable`, and adding
`nonnull` or `_Nullable` yields a mutual-exclusivity error. When
`-Wnullability-completeness` is enabled, however, non-audited header
regions require adding the `nullable` property keyword to avoid a
warning. This should be unnecessary, since it restates known nullability
of the `weak` property.

Additionally, the fix-it hints are both non-idiomatic Objective-C
(adding `_Nullable` to the property's pointer type rather than in the
`@property` attributes) and suggest the option of adding `_Nonnull`,
which would be an error.

Differential Revision: https://reviews.llvm.org/D128031




More information about the All-commits mailing list