aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/ivar-lookup.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/ivar-lookup.m')
-rw-r--r--test/SemaObjC/ivar-lookup.m19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaObjC/ivar-lookup.m b/test/SemaObjC/ivar-lookup.m
index 644b3b638c92..06e47116f73c 100644
--- a/test/SemaObjC/ivar-lookup.m
+++ b/test/SemaObjC/ivar-lookup.m
@@ -16,3 +16,22 @@ extern struct foo x;
}
@end
+
+@interface Ivar
+- (float*)method;
+@end
+
+@interface A {
+ A *Ivar;
+}
+- (int*)method;
+@end
+
+@implementation A
+- (int*)method {
+ int *ip = [Ivar method]; // expected-warning{{warning: incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
+ // Note that there is no warning in Objective-C++
+ return 0;
+}
+@end
+