Index: lib/Sema/SemaType.cpp =================================================================== --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -2285,8 +2285,9 @@ // Methods cannot return interface types. All ObjC objects are // passed by reference. if (T->isObjCObjectType()) { - Diag(Loc, diag::err_object_cannot_be_passed_returned_by_value) << 0 << T; - return 0; + Diag(Loc, diag::err_object_cannot_be_passed_returned_by_value) + << 0 << T << FixItHint::CreateInsertion(Loc, "*"); + return true; } return false; Index: test/SemaObjC/method-bad-param.m =================================================================== --- test/SemaObjC/method-bad-param.m +++ test/SemaObjC/method-bad-param.m @@ -20,6 +20,12 @@ } @end +// Ensure that this function is properly marked as a failure. +void func_with_bad_call(bar* b, foo* f) { + [b cccccc:5]; // expected-warning {{instance method '-cccccc:' not found}} + // expected-note@-17 {{receiver is instance of class declared here}} +} + void somefunc(foo x) {} // expected-error {{interface type 'foo' cannot be passed by value; did you forget * in 'foo'}} foo somefunc2() {} // expected-error {{interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}