Improve the "bad receiver" warning for ObjC message sends to be less confusing.

llvm-svn: 66635
This commit is contained in:
Chris Lattner 2009-03-11 03:47:47 +00:00
parent 0fa538528e
commit 6e76e592a3
4 changed files with 5 additions and 5 deletions

View File

@ -982,7 +982,7 @@ DIAG(error_no_super_class, ERROR,
DIAG(err_invalid_receiver_to_message, ERROR,
"invalid receiver to message expression")
DIAG(warn_bad_receiver_type, WARNING,
"bad receiver type %0")
"receiver type %0 is not 'id' or Objective-C interface pointer, consider casting it to 'id'")
DIAG(err_bad_receiver_type, ERROR,
"bad receiver type %0")
DIAG(error_objc_throw_expects_object, ERROR,

View File

@ -5,7 +5,7 @@
@end
void __raiseExc1() {
[objc_lookUpClass("NSString") retain]; // expected-warning {{ "bad receiver type 'int'" }} \
[objc_lookUpClass("NSString") retain]; // expected-warning {{receiver type 'int' is not 'id'}} \
expected-warning {{method '-retain' not found}}
}
@ -14,6 +14,6 @@ typedef const struct __CFString * CFStringRef;
void func() {
CFStringRef obj;
[obj self]; // expected-warning {{bad receiver type 'CFStringRef' (aka 'struct __CFString const *')}} \\
[obj self]; // expected-warning {{receiver type 'CFStringRef' (aka 'struct __CFString const *') is not 'id'}} \\
expected-warning {{method '-self' not found}}
}

View File

@ -80,7 +80,7 @@ int f2() {
struct S { int X; } S;
int test5(int X) {
int a = [X somemsg]; // expected-warning {{bad receiver type 'int'}} \
int a = [X somemsg]; // expected-warning {{receiver type 'int' is not 'id'}} \
expected-warning {{method '-somemsg' not found}} \
expected-warning {{incompatible pointer to integer conversion initializing 'id', expected 'int'}}
int b = [S somemsg]; // expected-error {{bad receiver type 'struct S'}}

View File

@ -32,7 +32,7 @@ void f(id super) {
[super m];
}
void f0(int super) {
[super m]; // expected-warning{{bad receiver type 'int'}} \
[super m]; // expected-warning{{receiver type 'int' is not 'id'}} \
expected-warning {{method '-m' not found (return type defaults to 'id')}}
}
void f1(int puper) {