erik.pilkington added inline comments.

================
Comment at: lib/Sema/SemaDeclAttr.cpp:7290
+      // when it's actually defined and is referenced from within the
+      // @implementation itself.
+      if (const auto *MD = dyn_cast<ObjCMethodDecl>(OffendingDecl)) {
----------------
Maybe add a sentence: In this context, we interpret unavailable as a form of 
access control.


================
Comment at: lib/Sema/SemaDeclAttr.cpp:7292
+      if (const auto *MD = dyn_cast<ObjCMethodDecl>(OffendingDecl)) {
+        if (const auto *Impl = dyn_cast<ObjCImplDecl>(Ctx)) {
+          if (MD->getClassInterface() == Impl->getClassInterface() &&
----------------
This should be `C` instead of `Ctx` right? Sorry, the naming here really sucks.


================
Comment at: test/SemaObjC/call-unavailable-init-in-self.m:57
+  (void)[Sub new]; // expected-error {{'new' is unavailable}}
+}
----------------
Can you add a test for category implementations:
```
@interface X @end

@interface X (Foo) 
-(void)meth __attribute__((unavailable))
@end

@implementation X (Foo)
-(void)meth {}
-(void)call_it { [self meth]; }
@end
```


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56469/new/

https://reviews.llvm.org/D56469



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to