This patch extends r350768 and allows the use of methods marked as unavailable that are declared in a parent class/category from within the @implementation of the class where the method is marked as unavailable.
This allows users to call init that's marked as unavailable even if they don't define it.
Details
Details
- Reviewers
erik.pilkington - Commits
- rGad1624ff4fe7: Merging r351459: --------------------------------------------------------------…
rG194d00e1425c: [ObjC] Follow-up r350768 and allow the use of unavailable methods that are…
rL351535: Merging r351459:
rL351459: [ObjC] Follow-up r350768 and allow the use of unavailable methods that are
rC351459: [ObjC] Follow-up r350768 and allow the use of unavailable methods that are
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
7373–7374 | Why not just always accept a use of an unavailable method so long as its declared in the interface? i.e., doesn't it make sense to accept something like the following? It seems like you're going out of your way to reject it though: @interface Base -(void)doAThing; -(void)doAThingImpl __attribute__((unavailable)); @end @implemenation Base -(void)doAThing { [self doAThingImpl]; } @end @interface Derived1 : Base @end @interface Derived2 : Base @end @implementation Derived1 -(void)doAThingImpl { ... } @end @implementation Derived2 -(void)doAThingImpl { ... } @end |
Why not just always accept a use of an unavailable method so long as its declared in the interface?
i.e., doesn't it make sense to accept something like the following? It seems like you're going out of your way to reject it though: