summaryrefslogtreecommitdiff
path: root/test/FixIt
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-08-19 23:39:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-08-19 23:39:17 +0000
commitb9f1d9e8410df27472c13c9fca922762d4844250 (patch)
treec019c0e5567c748906414a214a38f534615035ff /test/FixIt
parentfa39a24bb3d8ed2eea679dd544d083a4f1353d82 (diff)
downloadclang-b9f1d9e8410df27472c13c9fca922762d4844250.tar.gz
Objective-C [qoi]. Provide fix-it hint when sending
class method to an object receiver. rdar://16263395 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt')
-rw-r--r--test/FixIt/fixit-class-method-messaging.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/FixIt/fixit-class-method-messaging.m b/test/FixIt/fixit-class-method-messaging.m
new file mode 100644
index 0000000000..e2592d0c87
--- /dev/null
+++ b/test/FixIt/fixit-class-method-messaging.m
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// rdar://16263395
+
+@interface NSObject @end
+
+@interface I : NSObject // expected-note 3 {{receiver is instance of class declared here}}
++ (id) ClassMeth;
+- (I*) MethInstPI;
+@end
+
+I* pi;
+
+I* foobar();
+
+@implementation I
+- (id) PrivInstMeth {
+ [ foobar() ClassMeth]; // expected-warning {{instance method '-ClassMeth' not found (return type defaults to 'id')}} \
+ // expected-note {{receiver expression is here}}
+// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:5-[[@LINE-2]]:13}:"I
+ [[self MethInstPI] ClassMeth]; // expected-warning {{instance method '-ClassMeth' not found (return type defaults to 'id')}} \
+ // expected-note {{receiver expression is here}}
+// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:4-[[@LINE-2]]:21}:"I
+ return [pi ClassMeth]; // expected-warning {{instance method '-ClassMeth' not found (return type defaults to 'id')}} \
+ // expected-note {{receiver expression is here}}
+// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"I
+}
++ (id) ClassMeth { return 0; }
+- (I*) MethInstPI { return 0; }
+@end