[all-commits] [llvm/llvm-project] 50be48: [clang][ObjC] Allow different availability annotat...

Alex Lorenz via All-commits all-commits at lists.llvm.org
Wed May 19 12:14:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50be48b0f3c884a87ddf19c7c51abcab035c1efb
      https://github.com/llvm/llvm-project/commit/50be48b0f3c884a87ddf19c7c51abcab035c1efb
  Author: Alex Lorenz <arphaman at gmail.com>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/test/SemaObjC/attr-availability.m
    A clang/test/SemaObjC/override-opt-prop-availability.m

  Log Message:
  -----------
  [clang][ObjC] Allow different availability annotation on a method
when implementing an optional protocol requirement

When an Objective-C method implements an optional protocol requirement,
allow the method to use a newer introduced or older obsoleted
availability version than what's specified on the method in the protocol
itself. This allows SDK adopters to adopt an optional method from a
protocol later than when the method is introduced in the protocol. The users
that call an optional method on an object that conforms to this protocol
are supposed to check whether the object implements the method or not,
so a lack of appropriate `if (@available)` check for a new OS version
is not a cause of concern as there's already another runtime check that's required.

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




More information about the All-commits mailing list