]> granicus.if.org Git - clang/commitdiff
Per feedback from Aaron Ballman, push cast-to-ObjCProtocolDecl inside handleObjCSuppr...
authorTed Kremenek <kremenek@apple.com>
Sat, 22 Feb 2014 01:06:05 +0000 (01:06 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 22 Feb 2014 01:06:05 +0000 (01:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201922 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp

index 88cdc756ec16f575b9b04fdc4cb5b37623ea8ed5..29e4bb7b3e26979ef669f273cffec7eac4cc37e5 100644 (file)
@@ -1643,9 +1643,9 @@ static void handleAttrWithMessage(Sema &S, Decl *D,
                                       Attr.getAttributeSpellingListIndex()));
 }
 
-static void handleObjCSuppresProtocolAttr(Sema &S, ObjCProtocolDecl *D,
+static void handleObjCSuppresProtocolAttr(Sema &S, Decl *D,
                                           const AttributeList &Attr) {
-  if (!D->isThisDeclarationADefinition()) {
+  if (!cast<ObjCProtocolDecl>(D)->isThisDeclarationADefinition()) {
     S.Diag(Attr.getLoc(), diag::err_objc_attr_protocol_requires_definition)
       << Attr.getName() << Attr.getRange();
     return;
@@ -4197,7 +4197,7 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
   case AttributeList::AT_ObjCRootClass:
     handleSimpleAttribute<ObjCRootClassAttr>(S, D, Attr); break;
   case AttributeList::AT_ObjCExplicitProtocolImpl:
-    handleObjCSuppresProtocolAttr(S, cast<ObjCProtocolDecl>(D), Attr);
+    handleObjCSuppresProtocolAttr(S, D, Attr);
     break;
   case AttributeList::AT_ObjCRequiresPropertyDefs:
     handleSimpleAttribute<ObjCRequiresPropertyDefsAttr>(S, D, Attr); break;