[all-commits] [llvm/llvm-project] 85cca9: [SemaObjC] Forbid storing an unboxed integer liter...

Erik Pilkington via All-commits all-commits at lists.llvm.org
Mon Apr 20 12:23:39 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 85cca945b4c93ecfd3f3bb7a7b2d5fa4104c3560
      https://github.com/llvm/llvm-project/commit/85cca945b4c93ecfd3f3bb7a7b2d5fa4104c3560
  Author: Erik Pilkington <erik.pilkington at gmail.com>
  Date:   2020-04-20 (Mon, 20 Apr 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprObjC.cpp
    M clang/lib/Sema/SemaInit.cpp
    A clang/test/SemaObjC/objc-literal-fixit.m

  Log Message:
  -----------
  [SemaObjC] Forbid storing an unboxed integer literal in an NSNumber

This fixes a common mistake (the 3 should be @3): NSNumber *n = 3. This extends
an existing check for NSString. Also, this only errs if the initializer isn't a
null pointer constant, so NSNumber *n = 0; continues to work. rdar://47029572

Differential revision: https://reviews.llvm.org/D78066




More information about the All-commits mailing list