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