From: Alex Lorenz Date: Thu, 5 Apr 2018 18:12:06 +0000 (+0000) Subject: Remove the temporary availability checking workaround for X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe9bac40707c0422d5d005717b6d0f915d5dd726;p=clang Remove the temporary availability checking workaround for the nested declarations in @interface. rdar://28825862 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329324 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 1d2c3b5534..709ba377a4 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -6828,28 +6828,6 @@ static bool ShouldDiagnoseAvailabilityInContext(Sema &S, AvailabilityResult K, return false; }; - // FIXME: This is a temporary workaround! Some existing Apple headers depends - // on nested declarations in an @interface having the availability of the - // interface when they really shouldn't: they are members of the enclosing - // context, and can referenced from there. - if (S.OriginalLexicalContext && cast(S.OriginalLexicalContext) != Ctx) { - const auto *OrigCtx = cast(S.OriginalLexicalContext); - if (CheckContext(OrigCtx)) - return false; - - // An implementation implicitly has the availability of the interface. - if (const auto *CatOrImpl = dyn_cast(OrigCtx)) { - if (const ObjCInterfaceDecl *Interface = CatOrImpl->getClassInterface()) - if (CheckContext(Interface)) - return false; - } - // A category implicitly has the availability of the interface. - else if (const auto *CatD = dyn_cast(OrigCtx)) - if (const ObjCInterfaceDecl *Interface = CatD->getClassInterface()) - if (CheckContext(Interface)) - return false; - } - do { if (CheckContext(Ctx)) return false; diff --git a/test/SemaObjC/class-unavail-warning.m b/test/SemaObjC/class-unavail-warning.m index f7d8f569ca..30ebf7939e 100644 --- a/test/SemaObjC/class-unavail-warning.m +++ b/test/SemaObjC/class-unavail-warning.m @@ -115,9 +115,9 @@ UNAVAILABLE __attribute__((objc_root_class)) } @end -typedef int unavailable_int UNAVAILABLE; +typedef int unavailable_int UNAVAILABLE; // expected-note {{'unavailable_int' has been explicitly marked unavailable here}} UNAVAILABLE @interface A -extern unavailable_int global_unavailable; // FIXME: this should be an error! +extern unavailable_int global_unavailable; // expected-error {{'unavailable_int' is unavailable: not available}} @end