def err_objc_bridged_related_known_method : Error<
"%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
"method for this conversion">;
-
+
+def err_objc_attr_protocol_requires_definition : Error<
+ "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
+
// Function Parameter Semantic Analysis.
def err_param_with_void_type : Error<"argument may not have 'void' type">;
def err_void_only_param : Error<
Attr.getAttributeSpellingListIndex()));
}
-static void handleObjCSuppresProtocolAttr(Sema &S, Decl *D,
+static void handleObjCSuppresProtocolAttr(Sema &S, ObjCProtocolDecl *D,
const AttributeList &Attr) {
+ if (!D->isThisDeclarationADefinition()) {
+ S.Diag(Attr.getLoc(), diag::err_objc_attr_protocol_requires_definition)
+ << Attr.getName() << Attr.getRange();
+ return;
+ }
+
D->addAttr(::new (S.Context)
ObjCExplicitProtocolImplAttr(Attr.getRange(), S.Context,
Attr.getAttributeSpellingListIndex()));
case AttributeList::AT_ObjCRootClass:
handleSimpleAttribute<ObjCRootClassAttr>(S, D, Attr); break;
case AttributeList::AT_ObjCExplicitProtocolImpl:
- handleObjCSuppresProtocolAttr(S, D, Attr);
+ handleObjCSuppresProtocolAttr(S, cast<ObjCProtocolDecl>(D), Attr);
break;
case AttributeList::AT_ObjCRequiresPropertyDefs:
handleSimpleAttribute<ObjCRequiresPropertyDefsAttr>(S, D, Attr); break;