-
- Downloads
[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
Showing
- clang/include/clang/Sema/Sema.h 3 additions, 0 deletionsclang/include/clang/Sema/Sema.h
- clang/lib/Sema/SemaDecl.cpp 8 additions, 5 deletionsclang/lib/Sema/SemaDecl.cpp
- clang/lib/Sema/SemaDeclAttr.cpp 9 additions, 0 deletionsclang/lib/Sema/SemaDeclAttr.cpp
- clang/test/SemaObjC/attr-availability.m 3 additions, 4 deletionsclang/test/SemaObjC/attr-availability.m
- clang/test/SemaObjC/override-opt-prop-availability.m 47 additions, 0 deletionsclang/test/SemaObjC/override-opt-prop-availability.m
Loading
Please register or sign in to comment