forked from OSchip/llvm-project
Improve the "bad receiver" warning for ObjC message sends to be less confusing.
llvm-svn: 66635
This commit is contained in:
parent
0fa538528e
commit
6e76e592a3
|
@ -982,7 +982,7 @@ DIAG(error_no_super_class, ERROR,
|
||||||
DIAG(err_invalid_receiver_to_message, ERROR,
|
DIAG(err_invalid_receiver_to_message, ERROR,
|
||||||
"invalid receiver to message expression")
|
"invalid receiver to message expression")
|
||||||
DIAG(warn_bad_receiver_type, WARNING,
|
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,
|
DIAG(err_bad_receiver_type, ERROR,
|
||||||
"bad receiver type %0")
|
"bad receiver type %0")
|
||||||
DIAG(error_objc_throw_expects_object, ERROR,
|
DIAG(error_objc_throw_expects_object, ERROR,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
void __raiseExc1() {
|
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}}
|
expected-warning {{method '-retain' not found}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,6 @@ typedef const struct __CFString * CFStringRef;
|
||||||
void func() {
|
void func() {
|
||||||
CFStringRef obj;
|
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}}
|
expected-warning {{method '-self' not found}}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ int f2() {
|
||||||
struct S { int X; } S;
|
struct S { int X; } S;
|
||||||
|
|
||||||
int test5(int X) {
|
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 {{method '-somemsg' not found}} \
|
||||||
expected-warning {{incompatible pointer to integer conversion initializing 'id', expected 'int'}}
|
expected-warning {{incompatible pointer to integer conversion initializing 'id', expected 'int'}}
|
||||||
int b = [S somemsg]; // expected-error {{bad receiver type 'struct S'}}
|
int b = [S somemsg]; // expected-error {{bad receiver type 'struct S'}}
|
||||||
|
|
|
@ -32,7 +32,7 @@ void f(id super) {
|
||||||
[super m];
|
[super m];
|
||||||
}
|
}
|
||||||
void f0(int super) {
|
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')}}
|
expected-warning {{method '-m' not found (return type defaults to 'id')}}
|
||||||
}
|
}
|
||||||
void f1(int puper) {
|
void f1(int puper) {
|
||||||
|
|
Loading…
Reference in New Issue