aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjCXX/ivar-lookup.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjCXX/ivar-lookup.mm')
-rw-r--r--test/SemaObjCXX/ivar-lookup.mm18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaObjCXX/ivar-lookup.mm b/test/SemaObjCXX/ivar-lookup.mm
new file mode 100644
index 000000000000..bb26f48f13d5
--- /dev/null
+++ b/test/SemaObjCXX/ivar-lookup.mm
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+@interface Ivar
+- (float*)method;
+@end
+
+@interface A {
+ A *Ivar;
+}
+- (int*)method;
+@end
+
+@implementation A
+- (int*)method {
+ int *ip = [Ivar method]; // Okay; calls A's method on the instance variable Ivar.
+ // Note that Objective-C calls Ivar's method.
+ return 0;
+}
+@end