[PATCH] D27600: [analyzer] Refine the diagnostics in the nullability checker to differentiate between nil and null

Anna Zaks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 9 10:27:06 PST 2016


zaks.anna added a comment.

Looks like Sema uses "null" not only when referring to literals (see below). Also, if we were referring to literals, we would use single quotes, no?

I suggest keeping as is for consistency with the wording that uses nil. I do not see much difference between the two cases..

  TestObject * _Nonnull returnsNilObjCInstanceDirectly() {
     // The first warning is from Sema. The second is from the static analyzer.
     return nil; // expected-warning {{null returned from function that requires a non-null return value}}
                 // expected-warning at -1 {{nil returned from a function that is expected to return a non-null value}}
  }




https://reviews.llvm.org/D27600





More information about the cfe-commits mailing list