xref: /llvm-project/clang/test/FixIt/fixit-class-method-messaging.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2// RUN: %clang_cc1 -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
3
4@interface NSObject @end
5
6@interface I : NSObject // expected-note 3 {{receiver is instance of class declared here}}
7+ (id) ClassMeth;
8- (I*) MethInstPI;
9@end
10
11I* pi;
12
13I* foobar(void);
14
15@implementation I
16- (id) PrivInstMeth {
17  [ foobar() ClassMeth]; // expected-warning {{instance method '-ClassMeth' not found (return type defaults to 'id')}} \
18			 // expected-note {{receiver expression is here}}
19// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:5-[[@LINE-2]]:13}:"I
20  [[self MethInstPI] ClassMeth]; // expected-warning {{instance method '-ClassMeth' not found (return type defaults to 'id')}} \
21				 // expected-note {{receiver expression is here}}
22// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:4-[[@LINE-2]]:21}:"I
23  return [pi ClassMeth]; // expected-warning {{instance method '-ClassMeth' not found (return type defaults to 'id')}} \
24                         // expected-note {{receiver expression is here}}
25// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"I
26}
27+ (id) ClassMeth { return 0; }
28- (I*) MethInstPI { return 0; }
29@end
30