From 979780f68f7a81c090f3a45e8167f80ff94660a5 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 6 Sep 2012 18:38:58 +0000 Subject: refactoring + objective-C specific test for my last patch. // rdar://12233989 llvm-svn: 163338 --- clang/lib/Sema/SemaExpr.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'clang/lib/Sema/SemaExpr.cpp') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index a67d5c6bd09..cfa9ccbfc33 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -69,10 +69,7 @@ bool Sema::CanUseDecl(NamedDecl *D) { static void DiagnoseUnusedOfDecl(Sema &S, NamedDecl *D, SourceLocation Loc) { // Warn if this is used but marked unused. if (D->hasAttr()) { - const Decl *DC = cast(S.getCurLexicalContext()); - // A category implicitly has the availability of the interface. - if (const ObjCCategoryDecl *CatD = dyn_cast(DC)) - DC = CatD->getClassInterface(); + const Decl *DC = cast(S.getCurObjCLexicalContext()); if (!DC->hasAttr()) S.Diag(Loc, diag::warn_used_but_marked_unused) << D->getDeclName(); } -- cgit v1.2.3