aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-12-11 18:53:07 +0000
committerDouglas Gregor <dgregor@apple.com>2012-12-11 18:53:07 +0000
commit86f6cf6800fa7ea3669e057c56f3487c4da3ef46 (patch)
tree508698c2a43e64636059d6e458e15cd486c9d559 /lib/Sema
parenta07b59e5e9b55033239c80552094421a01b75c8a (diff)
Don't complain about incomplete implementations for methods that are
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
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 14546deef0..64b000ee9a 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1168,8 +1168,17 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
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;