"expected string literal or '[' for asm operand")
DIAG(err_expected_selector_for_method, ERROR,
"expected selector for Objective-C method")
+DIAG(err_object_as_method_param, ERROR,
+ "can not use an object as parameter to a method")
DIAG(err_nsobject_attribute, ERROR,
"__attribute ((NSObject)) is for pointer types only")
}
else if (argType->isFunctionType())
argType = Context.getPointerType(argType);
+ else if (argType->isObjCInterfaceType()) {
+ // FIXME! provide more precise location for the parameter
+ Diag(MethodLoc, diag::err_object_as_method_param);
+ return 0;
+ }
} else
argType = Context.getObjCIdType();
ParmVarDecl* Param;
--- /dev/null
+// RUN: clang -fsyntax-only -verify %s
+
+@interface foo
+@end
+
+@implementation foo
+@end
+
+@interface bar
+-(void) my_method:(foo) my_param; // expected-error {{can not use an object as parameter to a method}}
+@end
+
+@implementation bar
+-(void) my_method:(foo) my_param // expected-error {{can not use an object as parameter to a method}}
+{
+}
+@end
+