// Type
def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
+def warn_receiver_forward_class : Warning<
+ "receiver %0 is a forward class and corresponding @interface may not exist">;
def warn_missing_declspec : Warning<
"declaration specifier missing, defaulting to 'int'">;
def warn_missing_type_specifier : Warning<
assert(ClassDecl && "missing interface declaration");
ObjCMethodDecl *Method = 0;
QualType returnType;
- Method = ClassDecl->lookupClassMethod(Context, Sel);
+ if (ClassDecl->isForwardDecl()) {
+ // A forward class used in messaging is tread as a 'Class'
+ Method = LookupFactoryMethodInGlobalPool(Sel, SourceRange(lbrac,rbrac));
+ if (Method)
+ Diag(lbrac, diag::warn_receiver_forward_class)
+ << ClassDecl->getDeclName();
+ }
+ if (!Method)
+ Method = ClassDecl->lookupClassMethod(Context, Sel);
// If we have an implementation in scope, check "private" methods.
if (!Method)