[PATCH] D59806: [clang-tidy] Add a check for [super self] in initializers 🔍

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 29 21:19:55 PDT 2019


rjmccall added a comment.

In D59806#1448537 <https://reviews.llvm.org/D59806#1448537>, @stephanemoore wrote:

> In D59806#1447929 <https://reviews.llvm.org/D59806#1447929>, @jordan_rose wrote:
>
> > I don't think there's ever a reason to call `[super self]`, and doing so through a macro could easily indicate a bug.
>
>
> Agreed.
>
> The only relatively common usage of -[NSObject self] that I am aware of is through KVC, e.g., to construct a set of distinct objects using array operators:


It's used idiomatically in ARC and GC as a way of preventing an object from being deallocated before a certain point, since the compiler cannot eliminate the call to `self`.  But that shouldn't affect this warning.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59806/new/

https://reviews.llvm.org/D59806





More information about the cfe-commits mailing list