summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-03-01 09:20:14 +0000
committerJohn McCall <rjmccall@apple.com>2013-03-01 09:20:14 +0000
commit80c93a0793c4c2afab4e5b4155d91f573fe7bd1c (patch)
treefaebf940c69e2d0f3a7a937912f9ab3b1628ae97 /clang/test/SemaObjC
parent323771b3f1970bf7d17c2944bf24248267964c51 (diff)
downloadbcm5719-llvm-80c93a0793c4c2afab4e5b4155d91f573fe7bd1c.tar.gz
bcm5719-llvm-80c93a0793c4c2afab4e5b4155d91f573fe7bd1c.zip
Perform the receiver-expression transformations regardless of
whether we already have a method. Fixes a bug where we were failing to properly contextually convert a message receiver during template instantiation. As a side-effect, we now actually perform correct method lookup after adjusting a message-send to integral or non-ObjC pointer types (legal outside of ARC). rdar://13305374 llvm-svn: 176339
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/bad-receiver-1.m3
-rw-r--r--clang/test/SemaObjC/message.m2
-rw-r--r--clang/test/SemaObjC/super.m3
-rw-r--r--clang/test/SemaObjC/warn-isa-ref.m8
4 files changed, 6 insertions, 10 deletions
diff --git a/clang/test/SemaObjC/bad-receiver-1.m b/clang/test/SemaObjC/bad-receiver-1.m
index fe3eecff2bc..fe7f7f5b446 100644
--- a/clang/test/SemaObjC/bad-receiver-1.m
+++ b/clang/test/SemaObjC/bad-receiver-1.m
@@ -7,8 +7,7 @@
int objc_lookUpClass(const char*);
void __raiseExc1() {
- [objc_lookUpClass("NSString") retain]; // expected-warning {{receiver type 'int' is not 'id'}} \
- expected-warning {{method '-retain' not found}}
+ [objc_lookUpClass("NSString") retain]; // expected-warning {{receiver type 'int' is not 'id'}}
}
typedef const struct __CFString * CFStringRef;
diff --git a/clang/test/SemaObjC/message.m b/clang/test/SemaObjC/message.m
index 4015690bd0a..f43bdf98852 100644
--- a/clang/test/SemaObjC/message.m
+++ b/clang/test/SemaObjC/message.m
@@ -95,7 +95,7 @@ int test5(int X) {
void foo4() {
struct objc_object X[10];
- [X rect]; // expected-warning {{receiver type 'struct objc_object *' is not 'id' or interface pointer, consider casting it to 'id'}} expected-warning {{method '-rect' not found (return type defaults to 'id')}}
+ [X rect]; // expected-warning {{receiver type 'struct objc_object *' is not 'id' or interface pointer, consider casting it to 'id'}}
}
// rdar://13207886
diff --git a/clang/test/SemaObjC/super.m b/clang/test/SemaObjC/super.m
index cf48c196db2..fd069af7b02 100644
--- a/clang/test/SemaObjC/super.m
+++ b/clang/test/SemaObjC/super.m
@@ -51,8 +51,7 @@ void f(id super) {
[super m];
}
void f0(int super) {
- [super m]; // expected-warning{{receiver type 'int' is not 'id'}} \
- expected-warning {{method '-m' not found (return type defaults to 'id')}}
+ [super m]; // expected-warning{{receiver type 'int' is not 'id'}}
}
void f1(id puper) { // expected-note {{'puper' declared here}}
[super m]; // expected-error{{use of undeclared identifier 'super'}}
diff --git a/clang/test/SemaObjC/warn-isa-ref.m b/clang/test/SemaObjC/warn-isa-ref.m
index c20474d5b0d..39a5e454966 100644
--- a/clang/test/SemaObjC/warn-isa-ref.m
+++ b/clang/test/SemaObjC/warn-isa-ref.m
@@ -26,13 +26,11 @@ static void func() {
// GCC allows this, with the following warning:
// instance variable 'isa' is @protected; this will be a hard error in the future
//
- // FIXME: see if we can avoid the 2 warnings that follow the error.
+ // FIXME: see if we can avoid the warning that follows the error.
[(*y).isa self]; // expected-error {{instance variable 'isa' is protected}} \
- expected-warning{{receiver type 'struct objc_class *' is not 'id' or interface pointer, consider casting it to 'id'}} \
- expected-warning{{method '-self' not found (return type defaults to 'id')}}
+ expected-warning{{receiver type 'struct objc_class *' is not 'id' or interface pointer, consider casting it to 'id'}}
[y->isa self]; // expected-error {{instance variable 'isa' is protected}} \
- expected-warning{{receiver type 'struct objc_class *' is not 'id' or interface pointer, consider casting it to 'id'}} \
- expected-warning{{method '-self' not found (return type defaults to 'id')}}
+ expected-warning{{receiver type 'struct objc_class *' is not 'id' or interface pointer, consider casting it to 'id'}}
}
// rdar://11702488
OpenPOWER on IntegriCloud