summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2019-01-17 18:12:45 +0000
committerAlex Lorenz <arphaman@gmail.com>2019-01-17 18:12:45 +0000
commit194d00e1425c8aceefc82d4410285310868d74de (patch)
treea98c6d67838d3911538812b58778095e812decac /clang/lib
parent4fce28ca6e42ab48c48279b77e1e9b40729978ad (diff)
downloadbcm5719-llvm-194d00e1425c8aceefc82d4410285310868d74de.tar.gz
bcm5719-llvm-194d00e1425c8aceefc82d4410285310868d74de.zip
[ObjC] Follow-up r350768 and allow the use of unavailable methods that are
declared in a parent class from within the @implementation context This commit 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. rdar://47134898 Differential Revision: https://reviews.llvm.org/D56816 llvm-svn: 351459
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index eb95cc748b1..139ac8aab43 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -7365,13 +7365,11 @@ ShouldDiagnoseAvailabilityInContext(Sema &S, AvailabilityResult K,
return true;
} else if (K == AR_Unavailable) {
// It is perfectly fine to refer to an 'unavailable' Objective-C method
- // when it's actually defined and is referenced from within the
- // @implementation itself. In this context, we interpret unavailable as a
- // form of access control.
+ // when it is referenced from within the @implementation itself. In this
+ // context, we interpret unavailable as a form of access control.
if (const auto *MD = dyn_cast<ObjCMethodDecl>(OffendingDecl)) {
if (const auto *Impl = dyn_cast<ObjCImplDecl>(C)) {
- if (MD->getClassInterface() == Impl->getClassInterface() &&
- MD->isDefined())
+ if (MD->getClassInterface() == Impl->getClassInterface())
return true;
}
}
OpenPOWER on IntegriCloud