unavailable due to availability attributes. <rdar://problem/
12798237>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169903
91177308-0d34-0410-b5e6-
96231b3b80d8
void Sema::WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method,
bool &IncompleteImpl, unsigned DiagID) {
// No point warning no definition of method which is 'unavailable'.
- if (method->hasAttr<UnavailableAttr>())
+ switch (method->getAvailability()) {
+ case AR_Available:
+ case AR_Deprecated:
+ break;
+
+ // Don't warn about unavailable or not-yet-introduced methods.
+ case AR_NotYetIntroduced:
+ case AR_Unavailable:
return;
+ }
+
if (!IncompleteImpl) {
Diag(ImpLoc, diag::warn_incomplete_impl);
IncompleteImpl = true;
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
@interface I
- Meth; // expected-note{{method definition for 'Meth' not found}} \
// expected-note{{method 'Meth' declared here}}
+- unavailableMeth __attribute__((availability(macosx,unavailable)));
+- unavailableMeth2 __attribute__((unavailable));
@end
@implementation I // expected-warning{{incomplete implementation}}